### Question:
UserServiceImpl implements UserService { @Nonnull @Override public boolean checkIfUserExistsForUuId(@Nonnull final String uuId) { assertUserUuIdNotNull(uuId); logger.debug("Checking if user exists for uuid - {}", uuId); return userRepository.findByUuId(uuId).isPresent(); } UserServiceImpl(); @Nonnull @Override User getUserById(@Nonnull final Long id); @Transactional @Nonnull @Override User createUser(@Nonnull final UserDto userDto); @Nonnull @Override boolean checkIfUserExistsForUuId(@Nonnull final String uuId); @Nonnull @Override User getUserByUuId(@Nonnull final String uuId); @Transactional @Nonnull @Override User getOrCreateUserForUuId(final String uuId); UserRepository getUserRepository(); void setUserRepository(final UserRepository userRepository);  }### Answer:
@Test public void testCheckIfUserExistsForUuIdWithInvalidArguments() { resetAll(); replayAll(); try { userService.checkIfUserExistsForUuId(null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }
@Test public void testCheckIfUserExistsForUuIdWhenUserDoesNotExist() { final String uuId = "JBYIUYFITYDR^DITDTTYCTK"; resetAll(); expect(userRepository.findByUuId(eq(uuId))).andReturn(Optional.empty()).once(); replayAll(); final boolean result = userService.checkIfUserExistsForUuId(uuId); assertFalse(result); verifyAll(); }