### Question:
Range { public List<String> subList(List<String> list) { List<String> results = new ArrayList<String>(); results.addAll(list); if (getAbsoluteSize() > 0) { int min = 0; int max = 0; min = this.start; if (min < 0) { min = (list.size()) + this.start; } max = min + this.size; if (min == 0 && max < 0) { min = list.size() + max; max = list.size(); } if (min > max) { int oldmax = max; max = min; min = oldmax; } if (min < 0) { min = 0; } if (max > list.size()) { max = list.size(); } results = results.subList(min, max); } return results; } Range(int start, int size); int getStart(); int getAbsoluteStart(); int getSize(); int getAbsoluteSize(); List<String> subList(List<String> list);  }### Answer:
@Test public void testSubListWithStartZeroAndSizeZero() { Range range = new Range(0, 0); assertEquals(range.subList(zeroToHeight), zeroToHeight); }
@Test public void testSubListWithStartZeroAndSizeOneThousand() { Range range = new Range(0, 1000); assertEquals(range.subList(zeroToHeight), zeroToHeight); }
@Test public void testSubListWithHeadIntervalOne() { Range range = RangeFactory.createHeadRange(1); List<String> zero = Arrays.asList(new String[]{"0"}); assertEquals(range.subList(zeroToHeight), zero); }
@Test public void testSubListWithTailIntervalOne() { Range range = RangeFactory.createTailRange(1); List<String> height = Arrays.asList(new String[]{"8"}); assertEquals(range.subList(zeroToHeight), height); }
@Test public void testSubListWithStartZeroAndPositiveSize() { Range range = new Range(0, 4); List<String> zeroToThree = Arrays.asList(new String[]{"0", "1", "2", "3"}); assertEquals(range.subList(zeroToHeight), zeroToThree); }
@Test public void testSubListWithStartZeroAndNegativeSize() { Range range = new Range(0, -4); List<String> fiveToHeight = Arrays.asList(new String[]{"5", "6", "7", "8"}); assertEquals(range.subList(zeroToHeight), fiveToHeight); }
@Test public void testSubListWithStartMinusTwoAndSizeFour() { Range range = new Range(-2, 4); List<String> sevenToHeight = Arrays.asList(new String[]{"7", "8"}); assertEquals(range.subList(zeroToHeight), sevenToHeight); }
@Test public void testSubListWithStartMinusTwoAndSizeMinusFour() { Range range = new Range(-2, -4); List<String> threeToSix = Arrays.asList(new String[]{"3", "4", "5", "6"}); assertEquals(range.subList(zeroToHeight), threeToSix); }
@Test public void testSubListWithStartTwoAndSizeMinusFour() { Range range = new Range(2, -4); List<String> zeroToOne = Arrays.asList(new String[]{"0", "1"}); assertEquals(range.subList(zeroToHeight), zeroToOne); }