Range { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } Range that = (Range) o; return this.lower == that.lower && this.upper == that.upper; } Range();  Range(int lower, int upper);  Range(Range range); @Override boolean equals(Object o); @Override int hashCode(); int length(); Range set(int lower, int upper); Range set(Range range); Range setEmpty(); boolean isEmpty(); public int lower; public int upper; }
@Test public void testEquals() throws Exception { Range range1 = new Range(1, 2); Range range2 = new Range(1, 2); assertTrue("equals", range1.equals(range2)); }
@Test public void testEquals_Null() throws Exception { Range range = new Range(1, 2); assertFalse("inequality with null", range.equals(null)); }
@Test public void testEquals_Inequality() throws Exception { Range range1 = new Range(1, 2); Range range2 = new Range(2, 1); assertFalse("not equals", range1.equals(range2)); }