Range { public boolean isEmpty() { return this.lower >= this.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 testIsEmpty() throws Exception { Range range1 = new Range(); Range range2 = new Range(1, 2); assertTrue("range is empty", range1.isEmpty()); assertFalse("range is not empty", range2.isEmpty()); }