SplitByPagesParameters extends AbstractSplitByPageParameters { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof SplitByPagesParameters)) { return false; } SplitByPagesParameters parameter = (SplitByPagesParameters) other; return new EqualsBuilder().appendSuper(super.equals(other)).append(pages, parameter.pages).isEquals(); }  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 testEquals() { SplitByPagesParameters eq1 = new SplitByPagesParameters(); eq1.addPage(1); SplitByPagesParameters eq2 = new SplitByPagesParameters(); eq2.addPage(1); SplitByPagesParameters eq3 = new SplitByPagesParameters(); eq3.addPage(1); SplitByPagesParameters diff = new SplitByPagesParameters(); diff.addPage(2); TestUtils.testEqualsAndHashCodes(eq1, eq2, eq3, diff); }