@Test void existsWhenNull() throws Exception { UserManager currentUserManager = mock(UserManager.class); when(this.contextComponentManager.getInstance(UserManager.class, CurrentUserReference.class.getName())) .thenReturn(currentUserManager); this.userManager.exists(null); verify(currentUserManager).exists(CurrentUserReference.INSTANCE); }
@Override public boolean exists(UserReference userReference) { boolean exists; UserReference normalizedUserReference = userReference; if (normalizedUserReference == null) { normalizedUserReference = CurrentUserReference.INSTANCE; } if (GuestUserReference.INSTANCE == normalizedUserReference || SuperAdminUserReference.INSTANCE == normalizedUserReference) { exists = false; } else { exists = resolveUserManager(normalizedUserReference).exists(normalizedUserReference); } return exists; }
DefaultUserManager implements UserManager { @Override public boolean exists(UserReference userReference) { boolean exists; UserReference normalizedUserReference = userReference; if (normalizedUserReference == null) { normalizedUserReference = CurrentUserReference.INSTANCE; } if (GuestUserReference.INSTANCE == normalizedUserReference || SuperAdminUserReference.INSTANCE == normalizedUserReference) { exists = false; } else { exists = resolveUserManager(normalizedUserReference).exists(normalizedUserReference); } return exists; } }
DefaultUserManager implements UserManager { @Override public boolean exists(UserReference userReference) { boolean exists; UserReference normalizedUserReference = userReference; if (normalizedUserReference == null) { normalizedUserReference = CurrentUserReference.INSTANCE; } if (GuestUserReference.INSTANCE == normalizedUserReference || SuperAdminUserReference.INSTANCE == normalizedUserReference) { exists = false; } else { exists = resolveUserManager(normalizedUserReference).exists(normalizedUserReference); } return exists; }  }
DefaultUserManager implements UserManager { @Override public boolean exists(UserReference userReference) { boolean exists; UserReference normalizedUserReference = userReference; if (normalizedUserReference == null) { normalizedUserReference = CurrentUserReference.INSTANCE; } if (GuestUserReference.INSTANCE == normalizedUserReference || SuperAdminUserReference.INSTANCE == normalizedUserReference) { exists = false; } else { exists = resolveUserManager(normalizedUserReference).exists(normalizedUserReference); } return exists; }  @Override boolean exists(UserReference userReference); }
DefaultUserManager implements UserManager { @Override public boolean exists(UserReference userReference) { boolean exists; UserReference normalizedUserReference = userReference; if (normalizedUserReference == null) { normalizedUserReference = CurrentUserReference.INSTANCE; } if (GuestUserReference.INSTANCE == normalizedUserReference || SuperAdminUserReference.INSTANCE == normalizedUserReference) { exists = false; } else { exists = resolveUserManager(normalizedUserReference).exists(normalizedUserReference); } return exists; }  @Override boolean exists(UserReference userReference);  }