Here you can find the source of asList(final Iterable
private static <T> List<T> asList(final Iterable<T> iterable)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { /** Converts {@link Iterable} to {@link List}. */ private static <T> List<T> asList(final Iterable<T> iterable) { final ArrayList<T> list = new ArrayList<>(); iterable.forEach(input -> list.add(input)); return list;/*from w w w . j a v a2s .c o m*/ } }