### Question:
Result extends ArrayList<Result> { @Override public boolean equals(Object obj) { if (obj == null || !(obj instanceof Result)) { return false; } Result r = (Result) obj; if (EmptyResult.class.isAssignableFrom(r.getClass()) && this.isEmpty()) { return true; } if (EmptyResult.class.isAssignableFrom(this.getClass()) && r.isEmpty()) { return true; } if (isSingleResult() && r.isSingleResult()) { if (datatype == null) { return false; } switch (datatype) { case BOOLEAN: return (valueBoolean.equals(r.valueBoolean)); case CODED: return (valueCoded.equals(r.valueCoded)); case DATETIME: return (valueDatetime.equals(r.valueDatetime)); case NUMERIC: return (valueNumeric.equals(r.valueNumeric)); case TEXT: return (valueText.equals(r.valueText)); default: return false; } } if (isSingleResult() || r.isSingleResult()) { return false; } if (this.size() != r.size()) { return false; } for (int i = 0; i < this.size(); i++) { if (!this.get(i).equals(r.get(i))) { return false; } } return true; } Result();  Result(Result result);  Result(List<Result> list);  Result(Boolean valueBoolean);  Result(Date resultDate, Boolean valueBoolean, Object obj);  Result(Concept valueCoded);  Result(Date resultDate, Concept valueCoded, Object obj);  Result(Obs obs);  Result(Date valueDatetime);  Result(Date resultDate, Date valueDatetime, Object obj);  Result(Double valueNumeric);  Result(Date resultDate, Double valueNumeric, Object obj);  Result(Integer valueNumeric);  Result(Date resultDate, Integer valueNumeric, Object obj);  Result(String valueText);  Result(Date resultDate, String valueText, Object obj);  Result(Date resultDate, Datatype datatype, Boolean valueBoolean, Concept valueCoded, Date valueDatetime,
	    Double valueNumeric, String valueText, Object object); static final Result emptyResult(); Datatype getDatatype(); void setResultDate(Date resultDatetime); void setDatatype(Datatype datatype); void setValueBoolean(Boolean valueBoolean); void setValueCoded(Concept valueCoded); void setValueDatetime(Date valueDatetime); void setValueNumeric(Integer valueNumeric); void setValueNumeric(Double valueNumeric); void setValueText(String valueText); Date getResultDate(); Object getResultObject(); void setResultObject(Object object); Boolean toBoolean(); Concept toConcept(); Date toDatetime(); Double toNumber(); @Override String toString(); Object toObject(); boolean isNull(); boolean exists(); boolean contains(Concept concept); Result gt(Integer value); boolean containsConcept(Integer conceptId); boolean contains(Result result); Result unique(); @Override boolean equals(Object obj); @Override int hashCode(); @Override Result get(int index); Result earliest(); Result latest();  }### Answer:
@Test public void equals_shouldReturnTrueOnTwoEmptyResults() { Assert.assertTrue(new EmptyResult().equals(new Result())); }