DefaultUserService implements UserService { @Override public User lookup(String handle) { return repository.findByUsernameOrEmailAllIgnoreCase(handle, handle); } DefaultUserService(UserRepository repository, GroupService groupService); @Override User createUser(String username, String email, String password); @Override void updatePassword(String handle, String oldPassword, String newPassword); @Override void deleteUser(String handle); @Override User lookup(String handle); @Override User authenticate(String handle, String password);  }
@Test public void testLookingForNonExistentUser() { final User user = service.lookup("milad"); assertThat(user, is(nullValue())); }