ContentRange implements Serializable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ContentRange range = (ContentRange) o; return offset == range.offset && last == range.last && total == range.total; } ContentRange(int offset, int last, int total); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); int offset(); int last(); int total(); boolean isEmpty();  }
@Test public void equals() throws Exception { ContentRange range1 = new ContentRange(1, 2, 3); ContentRange range2 = new ContentRange(1, 2, 3); ContentRange range3 = new ContentRange(1, 2, 4); assertThat(range1).isEqualTo(range2); assertThat(range1.hashCode()).isEqualTo(range2.hashCode()); assertThat(range1).isNotEqualTo(range3); assertThat(range1.hashCode()).isNotEqualTo(range3.hashCode()); }