GroupUrlTitleInfoItemIdentifier extends BaseInfoItemIdentifier { @Override public int hashCode() { return Objects.hash(_groupId, _urlTitle); } GroupUrlTitleInfoItemIdentifier(long groupId, String urlTitle); @Override boolean equals(Object object); long getGroupId(); String getUrlTitle(); @Override int hashCode(); @Override String toString();  }
@Test public void testHashCode() { GroupUrlTitleInfoItemIdentifier groupUrlTitleInfoItemIdentifier1 = new GroupUrlTitleInfoItemIdentifier(12345L, "urlTitle"); GroupUrlTitleInfoItemIdentifier groupUrlTitleInfoItemIdentifier2 = new GroupUrlTitleInfoItemIdentifier(12345L, "urlTitle"); Assert.assertEquals( groupUrlTitleInfoItemIdentifier1.hashCode(), groupUrlTitleInfoItemIdentifier2.hashCode()); }
@Test public void testHashCodeWithDifferentGroupId() { GroupUrlTitleInfoItemIdentifier groupUrlTitleInfoItemIdentifier1 = new GroupUrlTitleInfoItemIdentifier(12345L, "urlTitle"); GroupUrlTitleInfoItemIdentifier groupUrlTitleInfoItemIdentifier2 = new GroupUrlTitleInfoItemIdentifier(22345L, "urlTitle"); Assert.assertNotEquals( groupUrlTitleInfoItemIdentifier1.hashCode(), groupUrlTitleInfoItemIdentifier2.hashCode()); }
@Test public void testHashCodeWithDifferentUrlTitle() { GroupUrlTitleInfoItemIdentifier groupUrlTitleInfoItemIdentifier1 = new GroupUrlTitleInfoItemIdentifier(12345L, "urlTitle1"); GroupUrlTitleInfoItemIdentifier groupUrlTitleInfoItemIdentifier2 = new GroupUrlTitleInfoItemIdentifier(12345L, "urlTitle2"); Assert.assertNotEquals( groupUrlTitleInfoItemIdentifier1.hashCode(), groupUrlTitleInfoItemIdentifier2.hashCode()); }