@Test public void testRange() throws Exception { int counter = 4; for (int i : Ints.range(4,8)) { assertEquals(counter++, i); } assertEquals(9, counter); counter = -12; for (int i : Ints.range(-12,0)) { assertEquals(counter++, i); } assertEquals(1, counter); boolean did12=false; for (int i : Ints.range(12,12)) { assertEquals(12, i); did12=true; } assertTrue(did12); }
public static Iterable<Integer> range(int start, int end) { return new Ints(start, end); }
Ints implements Iterable<Integer> { public static Iterable<Integer> range(int start, int end) { return new Ints(start, end); } }
Ints implements Iterable<Integer> { public static Iterable<Integer> range(int start, int end) { return new Ints(start, end); } private  Ints(int start, int end); }
Ints implements Iterable<Integer> { public static Iterable<Integer> range(int start, int end) { return new Ints(start, end); } private  Ints(int start, int end); static Iterable<Integer> until(int end); static Iterable<Integer> range(int start, int end); @Override Iterator<Integer> iterator(); }
Ints implements Iterable<Integer> { public static Iterable<Integer> range(int start, int end) { return new Ints(start, end); } private  Ints(int start, int end); static Iterable<Integer> until(int end); static Iterable<Integer> range(int start, int end); @Override Iterator<Integer> iterator();  }