PageRange implements PagesSelection { public boolean contains(int page) { return start <= page && end >= page; } 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 testContains() { assertTrue(new PageRange(1,1).contains(1)); assertTrue(new PageRange(1,2).contains(1)); assertTrue(new PageRange(1,2).contains(2)); assertTrue(new PageRange(1).contains(1)); assertTrue(new PageRange(1).contains(2)); assertFalse(new PageRange(2).contains(1)); assertFalse(new PageRange(2, 3).contains(1)); assertFalse(new PageRange(2, 3).contains(4)); }