SplitByPagesParameters extends AbstractSplitByPageParameters { @Override public Set<Integer> getPages(int upperLimit) { return Collections .unmodifiableSet(pages.stream().filter(p -> p <= upperLimit && p > 0).collect(Collectors.toSet())); }  void addPages(Collection<Integer> pagesToAdd); void addPage(Integer page); @Override Set<Integer> getPages(int upperLimit); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other);  }
@Test public void getPages() { SplitByPagesParameters victim = new SplitByPagesParameters(); victim.addPage(1); victim.addPage(10); assertEquals(1, victim.getPages(5).size()); assertEquals(2, victim.getPages(15).size()); }