### Question:
AbstractPushNotificationRecipientServiceImpl implements AbstractPushNotificationRecipientService<T> { @Transactional @Nonnull @Override public T updatePushNotificationRecipientUserDevice(@Nonnull final Long recipientId, @Nonnull final Long userDeviceId) { assertPushNotificationRecipientIdNotNull(recipientId); Assert.notNull(userDeviceId, "User device id should not be null"); LOGGER.debug("Updating user device for push notification recipient with id - {}, user device id - {}", recipientId, userDeviceId); T recipient = getRepository().findById(recipientId).orElseThrow(() -> new PushNotificationRecipientNotFoundForIdException(recipientId, getInstanceClass()));; final UserDevice userDevice = userDeviceService.getUserDeviceById(userDeviceId); assertPushNotificationRecipientAndDeviceBelongToSameUser(recipient, userDevice); PushNotificationRecipientDevice recipientDevice = pushNotificationRecipientDeviceRepository.findByRecipientAndDevice(recipient, userDevice); if (recipientDevice == null) { LOGGER.debug("Push notification recipient with id - {} is not yet associated with user device by id - {}, associating them.", recipient.getId(), userDevice.getId()); recipientDevice = new PushNotificationRecipientDevice(); recipientDevice.setRecipient(recipient); recipientDevice.setDevice(userDevice); recipientDevice = pushNotificationRecipientDeviceRepository.save(recipientDevice); recipient.getDevices().add(recipientDevice); LOGGER.debug("Successfully associated push notification recipient with id - {} to user device with id - {}, created recipient device id - {}", recipient.getId(), userDevice.getId(), recipientDevice.getId()); } recipient.setLastDevice(userDevice); recipient.setUpdated(LocalDateTime.now()); recipient = getRepository().save(recipient); LOGGER.debug("Successfully updated user device for push notification recipient with id - {}. User device id - {}", recipient.getId(), userDevice.getId()); return recipient; } AbstractPushNotificationRecipientServiceImpl(); @Nonnull @Override T getPushNotificationRecipientById(@Nonnull final Long recipientId); @Transactional @Nonnull @Override T updatePushNotificationRecipientUserDevice(@Nonnull final Long recipientId, @Nonnull final Long userDeviceId); @Transactional @Nonnull @Override T updatePushNotificationRecipientStatus(@Nonnull final Long recipientId, @Nonnull final PushNotificationRecipientStatus status); PushNotificationSubscriptionService getPushNotificationSubscriptionService(); void setPushNotificationSubscriptionService(final PushNotificationSubscriptionService pushNotificationSubscriptionService); PushNotificationRecipientRepository getPushNotificationRecipientRepository(); void setPushNotificationRecipientRepository(final PushNotificationRecipientRepository pushNotificationRecipientRepository); UserDeviceService getUserDeviceService(); void setUserDeviceService(final UserDeviceService userDeviceService); PushNotificationRecipientDeviceRepository getPushNotificationRecipientDeviceRepository(); void setPushNotificationRecipientDeviceRepository(final PushNotificationRecipientDeviceRepository pushNotificationRecipientDeviceRepository);  }### Answer:
@Test public void testUpdatePushNotificationRecipientUserDeviceWithInvalidArguments() { final Long recipientId = 1L; final Long userDeviceId = 2L; resetAll(); replayAll(); try { getService().updatePushNotificationRecipientUserDevice(null, userDeviceId); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } try { getService().updatePushNotificationRecipientUserDevice(recipientId, null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }