SetMetadataParameters extends SinglePdfSourceSingleOutputParameters { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof SetMetadataParameters)) { return false; } SetMetadataParameters parameter = (SetMetadataParameters) other; return new EqualsBuilder().appendSuper(super.equals(other)).append(metadata, parameter.metadata) .isEquals(); }  Map<String, String> getMetadata(); void putAll(Map<String, String> m); void put(String key, String metadata); @Override int hashCode(); @Override boolean equals(Object other);  }
@Test public void testEquals() { SetMetadataParameters eq1 = new SetMetadataParameters(); eq1.put(PdfMetadataFields.AUTHOR, "author"); SetMetadataParameters eq2 = new SetMetadataParameters(); eq2.put(PdfMetadataFields.AUTHOR, "author"); SetMetadataParameters eq3 = new SetMetadataParameters(); eq3.put(PdfMetadataFields.AUTHOR, "author"); SetMetadataParameters diff = new SetMetadataParameters(); diff.put(PdfMetadataFields.AUTHOR, "author"); diff.put(PdfMetadataFields.CREATOR, "creator"); TestUtils.testEqualsAndHashCodes(eq1, eq2, eq3, diff); }