### Question:
UserDeviceServiceImpl implements UserDeviceService { @Nonnull @Override public boolean checkIfUserDeviceExistsForUuId(@Nonnull final Long userId, @Nonnull final String uuId) { assertUserId(userId); assertUuIdNotNull(uuId); LOGGER.debug("Checking if user device exists for user with id - {}, device uuid - {}", userId, uuId); final User user = userService.getUserById(userId); final UserDevice userDevice = userDeviceRepository.findByUserAndUuId(user, uuId); final boolean exists = (userDevice != null); LOGGER.debug("User device lookup result for user with id - {} and device uuid - {} is - {}", userId, uuId, exists); return exists; } UserDeviceServiceImpl(); @Nonnull @Override UserDevice getUserDeviceById(@Nonnull final Long userDeviceId); @Transactional @Nonnull @Override UserDevice createUserDevice(@Nonnull final Long userId, @Nonnull final UserDeviceDto userDeviceDto); @Nonnull @Override UserDevice getUserDeviceByUuId(@Nonnull final Long userId, @Nonnull final String uuId); @Nonnull @Override boolean checkIfUserDeviceExistsForUuId(@Nonnull final Long userId, @Nonnull final String uuId); @Transactional @Nonnull @Override UserDevice getOrCreateUserDevice(@Nonnull final Long userId, @Nonnull final UserDeviceDto userDeviceDto); UserDeviceRepository getUserDeviceRepository(); void setUserDeviceRepository(final UserDeviceRepository userDeviceRepository);  }### Answer:
@Test public void testCheckIfUserDeviceExistsForUuId() { final Long userId = 1L; final String deviceUuId = "JBIYITCTUFFVIFIFOYFTII"; resetAll(); replayAll(); try { userDeviceService.checkIfUserDeviceExistsForUuId(null, deviceUuId); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } try { userDeviceService.checkIfUserDeviceExistsForUuId(userId, null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }