AmbariAuthentication implements Authentication, UserIdAuthentication { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AmbariAuthentication that = (AmbariAuthentication) o; return Objects.equals(authentication, that.authentication) && Objects.equals(principalOverride, that.principalOverride); } AmbariAuthentication(Authentication authentication, Integer userId); @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override Object getCredentials(); @Override Object getDetails(); @Override Object getPrincipal(); @Override boolean isAuthenticated(); @Override void setAuthenticated(boolean isAuthenticated); @Override String getName(); @Override boolean equals(Object o); @Override int hashCode(); @Override Integer getUserId();  }
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(AmbariAuthentication.class) .verify(); }