### Question:
AbstractPushNotificationRecipientServiceImpl implements AbstractPushNotificationRecipientService<T> { @Nonnull @Override public T getPushNotificationRecipientById(@Nonnull final Long recipientId) { assertPushNotificationRecipientIdNotNull(recipientId); LOGGER.debug("Getting push notification recipient for id - {}, class - {}", recipientId, getInstanceClass()); final T recipient = getRepository().findById(recipientId).orElseThrow(() -> new PushNotificationRecipientNotFoundForIdException(recipientId, getInstanceClass())); LOGGER.debug("Successfully retrieved push notification recipient for id - {}, class - {}, recipient - {}", recipient.getId(), getInstanceClass(), recipient); 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 testGetPushNotificationRecipientByIdWithInvalidArguments() { resetAll(); replayAll(); try { getService().getPushNotificationRecipientById(null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }
@Test public void testGetPushNotificationRecipientById() { final Long recipientId = 1L; final T recipient = getInstance(); recipient.setId(recipientId); resetAll(); expect(getRepository().findById(eq(recipientId))).andReturn(Optional.of(recipient)).once(); replayAll(); final T result = getService().getPushNotificationRecipientById(recipientId); assertEquals(recipient, result); verifyAll(); }