Range implements Iterable<Integer> { public static Range createWithCount(int start, int count) { return create(start, start + count); } private  Range(int start, int end, int step); static Range createWithCount(int start, int count); static Range create(int start, int end); static Range createWithStep(int start, int end, int step); @Override Iterator<Integer> iterator(); @Override String toString();  }
@Test public void testRangeWithCount() { assertEquals(Arrays.asList(1, 2, 3, 4, 5), toList(Range.createWithCount(1, 5))); }
@Test public void testRangeWithCount2() { assertEquals(Arrays.asList(2, 3, 4, 5), toList(Range.createWithCount(2, 4))); }
@Test public void testRangeWithCount3() { assertEquals(Arrays.asList(0, 1, 2, 3), toList(Range.createWithCount(0, 4))); }
@Test public void testRangeWithCount4() { assertEquals(Arrays.asList(10, 11, 12, 13, 14), toList(Range.createWithCount(10, 5))); }