Java Iterable to Collection iterableToCollection(Iterable iterable)

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

Description

iterable To Collection

License

Open Source License

Declaration

public static <T> Collection<T> iterableToCollection(Iterable<T> iterable) 

Method Source Code


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

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

public class Main {
    public static <T> Collection<T> iterableToCollection(Iterable<T> iterable) {
        Collection<T> collection = new ArrayList<>();
        iterable.forEach(collection::add);
        return collection;
    }//from www. j  av  a2s  .  c  o m
}

Related

  1. iterableToCollection(Iterable iter, Collection list)
  2. iterableToString(Iterable collection, String sep)
  3. iterableToString(String separator, Iterable collection)