Integers { public static ImmutableList<Integer> range(int start, int end) { Preconditions.checkArgument(end >= start, "End must be >= start"); List<Integer> result = Lists.newArrayList(); for (int i = start; i <= end; i++) { result.add(i); } return ImmutableList.copyOf(result); }  static ImmutableList<Integer> range(int start, int end);  }
@Test(expected = IllegalArgumentException.class) public void rangeInvalidRange() throws Exception { Integers.range(1 , 0); }
@Test public void testEmptyRange() throws Exception { assertEquals("[1]", Integers.range(1,1).toString()); }
@Test public void testBasicRange() throws Exception { assertEquals("[1, 2]", Integers.range(1,2).toString()); }