Page { @Override public int hashCode() { return new HashCodeBuilder() .append(parentPagePath) .append(title) .append(data) .append(contentType) .append(tags) .append(viewRestrictionRole) .toHashCode(); } Page(String title, String contentType, PageData data); static Page fromText(String title, String text); static Page fromData(byte[] data, String contentType); static Page fromMeta(String title, String contentType); void setViewRestrictionRole(String viewRestrictionRole); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testHashCode() { assertHashCodeContract( Page.fromText(TITLE, TEXT), Page.fromText(TITLE, TEXT)); }