### Question:
Range implements Comparable<Range> { public long size() { return (long)max - (long)min + 1; } Range(int min, int max); @Override int compareTo(Range other); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); boolean contains(int value); long size(); public int min; public int max; }### Answer:
@Test public void testSize() { Range r; for (int i = 0; i < goodPairs.length; i++) { int[] pair = goodPairs[i]; int min = pair[0]; int max = pair[1]; r = new Range(min, max); assertEquals("Bad size for range " + r.toString(), ((long) max - (long) min + 1), r.size()); } }