Blocked { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || !Objects.equals(getClass(), o.getClass())) { return false; } final Blocked blocked = (Blocked) o; return id == blocked.id && Objects.equals(amount, blocked.amount) && rating == blocked.rating; } Blocked(final int id, final Money amount, final Rating rating);  Blocked(final int id, final Money amount, final Rating rating, final boolean persistent); int getId(); Money getAmount(); Rating getRating(); boolean isValid(final RemoteData remoteData); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test void equals() { final Blocked b = new Blocked(2, Money.from(10), Rating.D); assertThat(b).isEqualTo(b); assertThat(b).isNotEqualTo(null); assertThat(b).isNotEqualTo(""); final Blocked sameB = new Blocked(2, Money.from(10), Rating.D); assertThat(sameB).isEqualTo(b); final Blocked differentB = new Blocked(2, Money.from(1), Rating.D); assertThat(differentB).isNotEqualTo(b); }