HostGroupConfigEntityPK { @Override public int hashCode() { return 31 * blueprintName.hashCode() + hostGroupName.hashCode() + type.hashCode(); }  String getBlueprintName(); void setBlueprintName(String blueprintName); String getHostGroupName(); void setHostGroupName(String hostGroupName); String getType(); void setType(String type); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testHashcode() { HostGroupConfigEntityPK pk1 = new HostGroupConfigEntityPK(); HostGroupConfigEntityPK pk2 = new HostGroupConfigEntityPK(); pk1.setType("foo"); pk2.setType("foo"); pk1.setBlueprintName("bp"); pk2.setBlueprintName("bp"); pk1.setHostGroupName("hg"); pk2.setHostGroupName("hg"); assertEquals(pk1.hashCode(), pk2.hashCode()); }