DefaultSyncResultImpl implements SyncResult { @Override @Nullable public DefaultSyncedIdentity getIdentity() { return id; } DefaultSyncResultImpl(@Nullable DefaultSyncedIdentity id, @NotNull Status status); @Override @Nullable DefaultSyncedIdentity getIdentity(); @Override @NotNull Status getStatus(); void setStatus(@NotNull Status status);  }
@Test public void testGetIdentityFromNull() { SyncResult res = new DefaultSyncResultImpl(null, SyncResult.Status.NOP); assertNull(res.getIdentity()); }
@Test public void testGetIdentity() { List<DefaultSyncedIdentity> l = new ArrayList<>(); l.add(new DefaultSyncedIdentity("id", null, true, -1)); l.add(new DefaultSyncedIdentity("id", new ExternalIdentityRef("id", "idp"), false, 500)); for (DefaultSyncedIdentity si : l) { assertEquals(si, new DefaultSyncResultImpl(si, SyncResult.Status.NOP).getIdentity()); } }