Range { public int length() { return (this.upper > this.lower) ? (this.upper - this.lower) : 0; } 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 testLength() throws Exception { Range range = new Range(1, 2); assertEquals("length", 1, range.length()); }
@Test public void testLength_Empty() throws Exception { Range range = new Range(); assertEquals("length", 0, range.length()); }