ParticipationDescriptor implements Descriptor<RecommendedParticipation, ParticipationDescriptor, Participation> { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || !Objects.equals(getClass(), o.getClass())) { return false; } final ParticipationDescriptor that = (ParticipationDescriptor) o; return Objects.equals(participation, that.participation); } ParticipationDescriptor(final Participation participation, final Supplier<Loan> related);  ParticipationDescriptor(final Participation participation, final Supplier<Loan> related,
            final Supplier<ParticipationDetail> detail); @Override Participation item(); @Override Loan related(); Optional<ParticipationDetail> detail(); Optional<RecommendedParticipation> recommend(); @Override Optional<RecommendedParticipation> recommend(final Money amount); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test void equals() { final Participation p = mockParticipation(BigDecimal.TEN); final ParticipationDescriptor pd = new ParticipationDescriptor(p, () -> LOAN); assertSoftly(softly -> { softly.assertThat(pd) .isNotEqualTo(null); softly.assertThat(pd) .isNotEqualTo(UUID.randomUUID() .toString()); softly.assertThat(pd) .isEqualTo(pd); }); final ParticipationDescriptor pd2 = new ParticipationDescriptor(p, () -> LOAN); assertSoftly(softly -> { softly.assertThat(pd) .isEqualTo(pd2); softly.assertThat(pd2) .isEqualTo(pd); }); final ParticipationDescriptor pd3 = new ParticipationDescriptor(mockParticipation(BigDecimal.ONE), () -> LOAN); assertSoftly(softly -> { softly.assertThat(pd) .isNotEqualTo(pd3); }); }