Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;
import java.util.List;
import java.util.ArrayList;

public class Main {
    public static <T> List<T> shallowCopyToList(Collection<T> collection) {
        ArrayList<T> copied = new ArrayList<T>(collection.size());
        for (T element : collection) {
            copied.add(element);
        }
        return copied;
    }
}