Java List Create createListFromList(Collection collection)

Here you can find the source of createListFromList(Collection collection)

Description

create List From List

License

Apache License

Declaration

public static <T> List<T> createListFromList(Collection<T> collection) 

Method Source Code


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

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

public class Main {
    public static <T> List<T> createListFromList(Collection<T> collection) {
        List<T> newList = new ArrayList<T>();

        if (collection != null) {
            newList.addAll(collection);// ww w.  jav a  2s. c om
        }

        return newList;
    }
}

Related

  1. createList(T... params)
  2. createListFrom(String... array)
  3. createListFromCollection(Collection collection)
  4. createListFromCommaDelimitedString(String access)
  5. createListFromDotSeparatedString(String s)
  6. createListOfObjects(T... elements)
  7. createListOfOneItem(Object item)
  8. createListOfValidNumberOfPoints(int[] terms, int min, int max)
  9. createListWithArray(Object[] array)