Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import java.util.Collection;

import java.util.Iterator;
import java.util.List;

public class Main {
    public static <T> List<T> ToList(Collection<List<T>> values) {
        List<T> alllist = new ArrayList<T>();
        Iterator<List<T>> iterator = values.iterator();
        List<T> list = null;
        while (iterator.hasNext()) {
            list = (List<T>) iterator.next();
            alllist.addAll(list);
        }
        return alllist;
    }
}