### Question:
AuthTargetMapping { @Override public boolean equals(Object other) { if (other instanceof AuthTargetMapping) { AuthTargetMapping otherMapping = (AuthTargetMapping)other; return mappings.equals(otherMapping.mappings); } return false; } private  AuthTargetMapping(AuthTargetMappingBuilder builder); static AuthTargetMappingBuilder builder(); AuthTarget getAuthTargetMapping(TokenTypeId tokenTypeId); @Override String toString(); @Override boolean equals(Object other); JsonValue toJson(); static AuthTargetMapping fromJson(JsonValue json); Map<String, Set<String>> marshalToAttributeMap(); static AuthTargetMapping marshalFromAttributeMap(Map<String, Set<String>> attributes); static final String AUTH_TARGET_MAPPINGS; }### Answer:
@Test public void testEquals() { AuthTargetMapping mapping1 = AuthTargetMapping .builder() .addMapping(TokenType.USERNAME, AMSTSConstants.AUTH_INDEX_TYPE_MODULE, USERNAME) .build(); AuthTargetMapping mapping2 = AuthTargetMapping .builder() .addMapping(TokenType.USERNAME, AMSTSConstants.AUTH_INDEX_TYPE_MODULE, USERNAME) .build(); assertEquals(mapping1, mapping2); assertEquals(USERNAME, mapping1.getAuthTargetMapping(TokenType.USERNAME).getAuthIndexValue()); assertEquals(AMSTSConstants.AUTH_INDEX_TYPE_MODULE, mapping1.getAuthTargetMapping(TokenType.USERNAME).getAuthIndexType()); AuthTargetMapping mapping3 = AuthTargetMapping .builder() .addMapping(TokenType.X509, AMSTSConstants.AUTH_INDEX_TYPE_MODULE, X509) .addMapping(TokenType.USERNAME, AMSTSConstants.AUTH_INDEX_TYPE_MODULE, USERNAME, buildContext()) .build(); AuthTargetMapping mapping4 = AuthTargetMapping .builder() .addMapping(TokenType.X509, AMSTSConstants.AUTH_INDEX_TYPE_MODULE, X509) .addMapping(TokenType.USERNAME, AMSTSConstants.AUTH_INDEX_TYPE_MODULE, USERNAME, buildContext()) .build(); assertEquals(mapping3, mapping4); assertEquals(X509, mapping3.getAuthTargetMapping(TokenType.X509).getAuthIndexValue()); assertEquals(AMSTSConstants.AUTH_INDEX_TYPE_MODULE, mapping3.getAuthTargetMapping(TokenType.USERNAME).getAuthIndexType()); AuthTargetMapping mapping5 = AuthTargetMapping .builder() .build(); AuthTargetMapping mapping6 = AuthTargetMapping .builder() .build(); assertEquals(mapping5, mapping6); }