### Question:
PushNotificationRecipientServiceImpl extends AbstractPushNotificationRecipientServiceImpl<PushNotificationRecipient> implements PushNotificationRecipientService { @Nonnull @Override public Long getPushNotificationRecipientsCountForSearchParameters(@Nonnull final PushNotificationRecipientSearchParameters searchParameters) { assertSearchParameters(searchParameters); LOGGER.debug("Getting push notification recipients count for payment search parameters - {}", searchParameters); final Long count = pushNotificationRecipientRepository.getPushNotificationRecipientsCount(convertParametersToFilter(searchParameters)); LOGGER.debug("Found - {} push notification recipients for search parameters - {}", count, searchParameters); return count; } PushNotificationRecipientServiceImpl(); @Nonnull @Override List<PushNotificationRecipient> getPushNotificationRecipientsForSearchParameters(@Nonnull final PushNotificationRecipientSearchParameters searchParameters, @Nonnull final Long startFrom, @Nonnull final Integer maxCount); @Nonnull @Override Long getPushNotificationRecipientsCountForSearchParameters(@Nonnull final PushNotificationRecipientSearchParameters searchParameters); @Transactional @Nonnull @Override PushNotificationRecipient createPushNotificationRecipient(@Nonnull final Long subscriptionId, @Nonnull final PushNotificationRecipientDto recipientDto); @Override PushNotificationRecipientRepository getPushNotificationRecipientRepository(); @Override void setPushNotificationRecipientRepository(final PushNotificationRecipientRepository pushNotificationRecipientRepository);  }### Answer:
@Test public void testGetPushNotificationRecipientsCountForSearchParametersWithInvalidArguments() { resetAll(); replayAll(); try { pushNotificationRecipientService.getPushNotificationRecipientsCountForSearchParameters(null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }
@Test public void testGetPushNotificationRecipientsCountForSearchParameters() { final PushNotificationRecipientSearchParameters parameters = createPushNotificationRecipientSearchParameters(); final PushNotificationRecipientSearchFilter filters = createPushNotificationRecipientSearchFilters(parameters); final Long recipientsCount = 10L; resetAll(); expect(getPushNotificationRecipientRepository().getPushNotificationRecipientsCount(eq(filters))).andReturn(recipientsCount).once(); replayAll(); final Long result = pushNotificationRecipientService.getPushNotificationRecipientsCountForSearchParameters(parameters); assertEquals(recipientsCount, result); verifyAll(); }