### Question:
QueryResultHashKey { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; QueryResultHashKey that = (QueryResultHashKey) o; return uniqueKey == that.uniqueKey && queryId.equals(that.queryId); } QueryResultHashKey(String queryId, long uniqueKey); String getQueryId(); void setQueryId(String queryId); long getUniqueKey(); void setUniqueKey(long uniqueKey); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void checkEquals(){ QueryResultHashKey key = new QueryResultHashKey(queryID, uniqueKey); assertTrue(key.equals(key)); assertFalse(key.equals(null)); assertFalse(key.equals(queryID)); assertFalse(key.equals(uniqueKey)); QueryResultHashKey that = new QueryResultHashKey(queryID, uniqueKey); assertEquals(key, that); that = new QueryResultHashKey(queryID+"abc", uniqueKey); assertNotEquals(key, that); that = new QueryResultHashKey(queryID, uniqueKey+1); assertNotEquals(key, that); }