Range implements Serializable { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Range other = (Range) obj; if (end != other.end) { return false; } if (start != other.start) { return false; } return true; } private  Range(final int start, final int end); Range[] partitionWith(final Range other); Range offsetBy(final int offset); static Range withOnly(final int integer); static Range between(final int start, final int end); static Range withLength(final int start, final int length); int getStart(); int getEnd(); int length(); boolean isEmpty(); boolean intersects(final Range other); boolean contains(final int integer); boolean isSubsetOf(final Range other); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); boolean startsBefore(final Range other); boolean endsBefore(final Range other); boolean endsAfter(final Range other); boolean startsAfter(final Range other); Range[] splitAt(final int integer); Range[] splitAtFromStart(final int length); Range combineWith(Range other); Range expand(int startDelta, int endDelta); Range restrictTo(Range bounds); IntStream stream();  }
@Test @SuppressWarnings("boxing") public void equalsTest() { final Range range1 = Range.between(0, 10); final Range range2 = Range.withLength(0, 11); assertTrue("null", !range1.equals(null)); assertTrue("reflexive", range1.equals(range1)); assertEquals("symmetric", range1.equals(range2), range2.equals(range1)); }