### Question:
QueryResultImpl implements QueryResult { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof QueryResult)) { return false; } final QueryResult other = (QueryResult) obj; if (this.terms == null) { return other.getTerms() == null; } else { return this.terms.equals(other.getTerms()); } } QueryResultImpl(List<Term> terms); @Override List<Term> getTerms(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testEquals() { final Constant c1 = Expressions.makeAbstractConstant("C"); final Constant c2 = Expressions.makeAbstractConstant("ddd"); final List<Term> constantList = Arrays.asList(c1, c1, c2); final QueryResult queryResult1 = new QueryResultImpl(constantList); final QueryResult queryResult2 = new QueryResultImpl(Arrays.asList(c1, c1, c2)); final QueryResult queryResult3 = new QueryResultImpl(Arrays.asList(c1, c2, c1)); assertEquals(queryResult1, queryResult1); assertEquals(queryResult2, queryResult1); assertEquals(queryResult2.hashCode(), queryResult1.hashCode()); assertNotEquals(queryResult3, queryResult1); assertNotEquals(queryResult3.hashCode(), queryResult1.hashCode()); assertNotEquals(new QueryResultImpl(null), queryResult1); assertEquals(new QueryResultImpl(null), new QueryResultImpl(null)); assertFalse(queryResult1.equals(null)); assertFalse(queryResult1.equals(constantList)); }