Java tutorial
//package com.java2s; import java.util.Iterator; public class Main { public static <T> Iterable<T> makeEmptyIterable() { return new Iterable<T>() { public Iterator<T> iterator() { return new Iterator<T>() { public boolean hasNext() { return false; } public T next() { return null; } public void remove() { throw new UnsupportedOperationException("remove not allowed"); } }; } }; } }