Java Collection Create toCollection(Iterable iterable)

Here you can find the source of toCollection(Iterable iterable)

Description

to Collection

License

Open Source License

Declaration

public static <E> Collection<E> toCollection(Iterable<E> iterable) 

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> Collection<E> toCollection(Iterable<E> iterable) {
        List<E> collection = new ArrayList<E>();
        iterable.forEach(e -> collection.add(e));
        return collection;
    }/* w  w w . j  av  a2s  .  c o  m*/
}

Related

  1. toCollection(Class cls, Iterable iterable)
  2. toCollection(Class cls, T[] array)
  3. toCollection(final char[] charArray)
  4. toCollection(final Iterable iterable)
  5. toCollection(final T[] elements)
  6. toCollection(Iterable i)
  7. toCollection(Object o)
  8. toCollection(String value)