### Question:
Range implements Comparable<Range> { @Override public String toString() { return "("+min+","+max+")"; } 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 testEqualsObject() { Range r1; Range r2; for (int i = 0; i < goodPairs.length; i++) { int[] pair = goodPairs[i]; int min = pair[0]; int max = pair[1]; r1 = new Range(min, max); r2 = new Range(min, max); assertEquals("Range equals() failed for " + r1.toString() + ".", r1, r2); } }
@Test public void testToString() { 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("(" + min + "," + max + ")", r.toString()); } }