@Test public void testUserHasChanged() { final User user15 = UserFactory.user().toBuilder().id(15).build(); final User user21 = UserFactory.user().toBuilder().id(21).build(); assertTrue(UserUtils.userHasChanged(null, UserFactory.user())); assertTrue(UserUtils.userHasChanged(UserFactory.user(), null)); assertTrue(UserUtils.userHasChanged(user15, user21)); assertFalse(UserUtils.userHasChanged(null, null)); assertFalse(UserUtils.userHasChanged(user15, user15)); }
public static boolean userHasChanged(final @Nullable User u1, final @Nullable User u2) { if (ObjectUtils.isNull(u1) && ObjectUtils.isNull(u2)) { return false; } else if (ObjectUtils.isNotNull(u1) && ObjectUtils.isNotNull(u2)) { return u1.id() != u2.id(); } return true; }
UserUtils { public static boolean userHasChanged(final @Nullable User u1, final @Nullable User u2) { if (ObjectUtils.isNull(u1) && ObjectUtils.isNull(u2)) { return false; } else if (ObjectUtils.isNotNull(u1) && ObjectUtils.isNotNull(u2)) { return u1.id() != u2.id(); } return true; } }
UserUtils { public static boolean userHasChanged(final @Nullable User u1, final @Nullable User u2) { if (ObjectUtils.isNull(u1) && ObjectUtils.isNull(u2)) { return false; } else if (ObjectUtils.isNotNull(u1) && ObjectUtils.isNotNull(u2)) { return u1.id() != u2.id(); } return true; } private  UserUtils(); }
UserUtils { public static boolean userHasChanged(final @Nullable User u1, final @Nullable User u2) { if (ObjectUtils.isNull(u1) && ObjectUtils.isNull(u2)) { return false; } else if (ObjectUtils.isNotNull(u1) && ObjectUtils.isNotNull(u2)) { return u1.id() != u2.id(); } return true; } private  UserUtils(); static boolean isLocationGermany(final @NonNull User user); static boolean userHasChanged(final @Nullable User u1, final @Nullable User u2); }
UserUtils { public static boolean userHasChanged(final @Nullable User u1, final @Nullable User u2) { if (ObjectUtils.isNull(u1) && ObjectUtils.isNull(u2)) { return false; } else if (ObjectUtils.isNotNull(u1) && ObjectUtils.isNotNull(u2)) { return u1.id() != u2.id(); } return true; } private  UserUtils(); static boolean isLocationGermany(final @NonNull User user); static boolean userHasChanged(final @Nullable User u1, final @Nullable User u2);  }