### Question:
TouchIdentifier { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TouchIdentifier that = (TouchIdentifier) o; return identifier == that.identifier; } TouchIdentifier(int aId); @Override boolean equals(Object o); @Override int hashCode(); final int identifier; }### Answer:
@Test public void testEquals() throws Exception { TouchIdentifier theIdentifier = new TouchIdentifier(10); TouchIdentifier theIdentifier1 = new TouchIdentifier(10); TouchIdentifier theIdentifier2 = new TouchIdentifier(11); assertEquals(theIdentifier, theIdentifier); assertEquals(theIdentifier, theIdentifier1); assertNotEquals(theIdentifier, theIdentifier2); assertNotEquals(theIdentifier, "lala"); assertNotEquals(theIdentifier, null); }