Java tutorial
//package com.java2s; import java.util.Collection; import java.util.LinkedList; public class Main { /** * Copy Iterable content to a list. * @param iter : Iterable * @return */ public static <E> Collection<E> makeCollection(Iterable<E> iter) { Collection<E> list = new LinkedList<E>(); for (E item : iter) { list.add(item); } return list; } }