Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.*;

public class Main {
    public static <T> List<T> concatenate(Collection<? extends T> a, Collection<? extends T> b) {
        List<T> list = new ArrayList<T>();
        list.addAll(a);
        list.addAll(b);
        return list;
    }

    public static <T> List<T> concatenate(Collection<? extends Collection<T>> lists) {
        List<T> list = new ArrayList<T>();
        for (Collection<T> c : lists) {
            list.addAll(c);
        }
        return list;
    }
}