SessionInfoImpl implements SessionInfo { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || !Objects.equals(getClass(), o.getClass())) { return false; } final SessionInfoImpl that = (SessionInfoImpl) o; return Objects.equals(userName, that.userName); } SessionInfoImpl(final String userName);  SessionInfoImpl(final String userName, final String name, final boolean isDryRun);  SessionInfoImpl(final Supplier<Consents> consents, final Supplier<Restrictions> restrictions,
            final String userName, final String name, final boolean isDryRun); @Override boolean isDryRun(); @Override String getUsername(); @Override String getName(); @Override boolean canInvest(); @Override boolean canAccessSmp(); @Override Money getMinimumInvestmentAmount(); @Override Money getInvestmentStep(); Money getMaximumInvestmentAmount(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test void equals() { final SessionInfo s = new SessionInfoImpl("someone@somewhere.cz"); final SessionInfo s2 = new SessionInfoImpl(UUID.randomUUID() .toString()); final SessionInfo s3 = new SessionInfoImpl("someone@somewhere.cz"); assertSoftly(softly -> { softly.assertThat(s) .isNotEqualTo(null); softly.assertThat(s) .isNotEqualTo(UUID.randomUUID() .toString()); softly.assertThat(s) .isEqualTo(s); softly.assertThat(s) .isNotEqualTo(s2); softly.assertThat(s2) .isNotEqualTo(s); softly.assertThat(s) .isEqualTo(s3); softly.assertThat(s3) .isEqualTo(s); }); }