### Question:
BasicResult extends AbstractResult implements Serializable { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (o != null && o.getClass().equals(BasicResult.class)) { BasicResult or = (BasicResult) o; return startEquality(or).isEquals(); } else { return false; } } BasicResult(long id, double score); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquality() { BasicResult result = new BasicResult(42, Math.PI); BasicResult equal = new BasicResult(42, Math.PI); BasicResult sameId = new BasicResult(42, Math.E); BasicResult sameScore = new BasicResult(37, Math.PI); BasicResult diff = new BasicResult(37, Math.E); assertThat(result.equals(null), equalTo(false)); assertThat(result.equals(result), equalTo(true)); assertThat(result.equals(equal), equalTo(true)); assertThat(result.equals(sameId), equalTo(false)); assertThat(result.equals(sameScore), equalTo(false)); assertThat(result.equals(diff), equalTo(false)); }