Here you can find the source of iterableToCollection(Iterable
public static <T> Collection<T> iterableToCollection(Iterable<T> iterable)
//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 }