Range { @Override public String toString() { return "[" + low + "," + high + "]"; } private  Range(int low, int high); static Range unbounded(); static Range boundedFromBelow(int lowerBound); static Range boundedFromAbove(int upperBound); static Range bounded(int lowerBound, int upperBound); boolean contains(int value); boolean contains(Range range); @Override boolean equals(Object object); @Override int hashCode(); int getLowerBound(); int getUpperBound(); int getWidth(); @Override String toString(); int getNearestValue(int value);  }
@Test public void testToString() { Assert.assertEquals("[1,2]", Range.bounded(1, 2).toString()); }