Here you can find the source of createIntegerIterator(int start)
public static Iterable<Integer> createIntegerIterator(int start)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; public class Main { public static Iterable<Integer> createIntegerIterator(int start) { return new Iterable<Integer>() { @Override//from ww w . ja va2 s . c o m public Iterator<Integer> iterator() { return new Iterator<Integer>() { private int counter = start; @Override public boolean hasNext() { return counter < Integer.MAX_VALUE; } @Override public Integer next() { return counter++; } }; } }; } }