@Test public void testNotEquals() { Map<ExternalIdentityRef, ExternalIdentityRef> notEqual = new HashMap<>(); notEqual.put(refNullProvider, ref); notEqual.put(refEmptyProvider, ref); notEqual.put(refNullProvider, null); notEqual.put(refNullProvider, new ExternalIdentityRef("anotherId", null)); notEqual.put(ref, new ExternalIdentityRef("anotherId", PROVIDER_NAME)); notEqual.put(ref, new ExternalIdentityRef(USERID, "anotherProvider")); for (Map.Entry<ExternalIdentityRef, ExternalIdentityRef> entry : notEqual.entrySet()) { ExternalIdentityRef r1 = entry.getKey(); ExternalIdentityRef r2 = entry.getValue(); assertFalse(r1.equals(r2)); if (r2 != null) { assertFalse(r2.equals(r1)); } } }
@Test public void testNotEqualsExternalIdentity() { assertFalse(ref.equals(new ExternalIdentity() { @NotNull @Override