### Question:
Rating { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Rating)) { return false; } Rating rhs = (Rating) o; return new EqualsBuilder() .append(dimension, rhs.dimension) .append(value, rhs.value) .append(max, rhs.max) .append(min, rhs.min) .isEquals(); }  @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); String getDimension(); void setDimension(String dimension); BigDecimal getValue(); void setValue(BigDecimal value); int getMax(); void setMax(int max); int getMin(); void setMin(int min);  }### Answer:
@Test public void testEquals() { assertFalse(rating.equals(null)); assertFalse(rating.equals(new Object())); Rating rating2 = new Rating(); assertTrue(rating.equals(rating2)); rating.setDimension("dimension"); assertFalse(rating.equals(rating2)); rating2.setDimension("dimension"); assertTrue(rating.equals(rating2)); assertEquals(rating.hashCode(), rating2.hashCode()); rating.setValue(new BigDecimal(421L)); assertFalse(rating.equals(rating2)); assertFalse(rating.toString().equals(rating2.toString())); }