PageRange implements PagesSelection { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof PageRange)) { return false; } PageRange range = (PageRange) other; return new EqualsBuilder().append(start, range.getStart()).append(end, range.getEnd()).isEquals(); } PageRange();  PageRange(int start, int end);  PageRange(int start); int getStart(); int getEnd(); boolean isUnbounded(); boolean intersects(PageRange range); @Override SortedSet<Integer> getPages(int totalNumberOfPage); boolean contains(int page); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); static PageRange one(int page);  }
@Test public void testEquals() { PageRange eq1 = new PageRange(1, 10); PageRange eq2 = new PageRange(1, 10); PageRange eq3 = new PageRange(1, 10); PageRange diff = new PageRange(1, 9); TestUtils.testEqualsAndHashCodes(eq1, eq2, eq3, diff); }