### Question:
DefaultUserDetails implements UserDetails { @Override public boolean equals(Object obj) { return ObjectEquals.of(this) .equals(obj, (orgin, other) -> Objects.equals(orgin.getUsername(), other.getUsername())); }  @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override String getPassword(); @Override String getUsername(); @Override boolean isAccountNonExpired(); @Override boolean isAccountNonLocked(); @Override boolean isCredentialsNonExpired(); @Override boolean isEnabled(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void shouldBeFalse_whenNotEqualsUsername() { UserDetails obj = DefaultUserDetails.builder() .username("admin") .build(); boolean output = userDetails.equals(obj); boolean expected = false; assertThat(output).isEqualTo(expected); }
@Test public void shouldBeTrue_whenEqualsUsername() { UserDetails obj = DefaultUserDetails.builder() .username("jittagornp") .build(); boolean output = userDetails.equals(obj); boolean expected = true; assertThat(output).isEqualTo(expected); }