TypedId { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Float.floatToIntBits(confidenceLevel); result = prime * result + ((type == null) ? 0 : type.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } TypedId(String value, String type,
			float confidenceLevel);  TypedId(); String getValue(); void setValue(String value); String getType(); void setType(String type); float getConfidenceLevel(); void setConfidenceLevel(float confidenceLevel); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testHashCode() throws Exception { String value = "someValue"; String type = "someType"; float confidenceLevel = 0.9f; TypedId typedId = new TypedId(value, type, confidenceLevel); assertNotEquals(typedId.hashCode(), new TypedId("otherValue", type, confidenceLevel).hashCode()); assertNotEquals(typedId.hashCode(), new TypedId(value, "otherType", confidenceLevel).hashCode()); assertNotEquals(typedId.hashCode(), new TypedId(value, type, 0.8f).hashCode()); assertEquals(typedId.hashCode(), new TypedId(value, type, confidenceLevel).hashCode()); }