Range { @Override public boolean equals(Object object) { if (!(object instanceof Range)) { return false; } Range range = (Range) object; return range.getLowerBound() == low && range.getUpperBound() == 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 testEquals() { Assert.assertEquals(Range.bounded(1, 1), Range.bounded(1, 1)); }