### Question:
ClientCredentials { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ClientCredentials that = (ClientCredentials) o; return Objects.equals(clientSecret, that.clientSecret) && Objects.equals(clientId, that.clientId); } ClientCredentials(@Nonnull String clientId, @Nonnull String clientSecret); String getSecret(); String getId(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void equals() { assertThat(cut.equals(cut), is(true)); assertThat(cut.equals(new ClientCredentials("clientId", "clientSecret")), is(true)); }
@Test public void not_equals() { assertThat(cut.equals(new ClientCredentials("clientId2", "clientSecret")), is(false)); assertThat(cut.equals(new ClientCredentials("clientId", "clientSecret2")), is(false)); assertThat(cut.equals(null), is(false)); assertThat(cut.equals(new Object()), is(false)); }