TypedId { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TypedId other = (TypedId) obj; if (Float.floatToIntBits(confidenceLevel) != Float .floatToIntBits(other.confidenceLevel)) return false; if (type == null) { if (other.type != null) return false; } else if (!type.equals(other.type)) return false; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.value)) return false; return true; } 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 testEquals() throws Exception { String value = "someValue"; String type = "someType"; float confidenceLevel = 0.9f; TypedId typedId = new TypedId(value, type, confidenceLevel); assertFalse(typedId.equals(null)); assertFalse(typedId.equals("string")); assertFalse(typedId.equals(new TypedId("otherValue", type, confidenceLevel))); assertFalse(typedId.equals(new TypedId(value, "otherType", confidenceLevel))); assertFalse(typedId.equals(new TypedId(value, type, 0.8f))); assertTrue(typedId.equals(new TypedId(value, type, confidenceLevel))); }