Here you can find the source of iterable(final Iterable
protected static <T> Iterable<T> iterable(final Iterable<T> in)
//package com.java2s; //License from project: Apache License import java.util.Iterator; public class Main { protected static <T> Iterable<T> iterable(final Iterable<T> in) { return new Iterable<T>() { @Override/*ww w.ja va 2 s . c o m*/ public Iterator<T> iterator() { return in.iterator(); } }; } }