Java List Create createMutableList(Collection collection)

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

Description

create Mutable List

License

Open Source License

Declaration

public static <E> List<E> createMutableList(Collection<E> collection) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static <E> List<E> createMutableList(Collection<E> collection) {
        List<E> mutableList = new ArrayList<>();
        if (isNotEmpty(collection)) {
            for (E data : collection) {
                mutableList.add(data);//from   w  w w  . j  a  va2  s . c  o m
            }
        }
        return mutableList;
    }

    public static <T> boolean isNotEmpty(Collection<T> collection) {
        return collection != null && collection.size() != 0;
    }
}

Related

  1. createMapOfObjects(List keys, List values)
  2. createMatrix(List source, List target)
  3. createMergedRegex(List regexes)
  4. createMultiParamMessage(String aPrefix, String aSuffix, List aParams)
  5. createMultiSelectionValue(List values)
  6. createNewList(Class type)
  7. createNormalDistributionByBootstrapping( List values1, List values2, final List sums1, final List sums2)
  8. createNormativeTroopAllocation( List probs)
  9. createNullElementList(int size)