### Question:
AbstractNotificationServiceImpl implements AbstractNotificationService<T> { @Nonnull @Override public T getNotificationById(@Nonnull final Long notificationId) { assertNotificationIdNotNull(notificationId); LOGGER.debug("Getting notification for id - {}, class - {}", notificationId, getInstanceClass()); final T notification = getRepository().findById(notificationId).orElseThrow(() -> new NotificationNotFoundForIdException(notificationId, getInstanceClass())); LOGGER.debug("Successfully retrieved notification for id - {}, notification class - {}", notificationId, getInstanceClass()); return notification; } AbstractNotificationServiceImpl(); @Nonnull @Override T getNotificationById(@Nonnull final Long notificationId); @Transactional @Nonnull @Override T updateNotificationState(@Nonnull final Long notificationId, @Nonnull final NotificationState notificationState); @Transactional @Nonnull @Override T updateProviderExternalUuid(@Nonnull final Long notificationId, @Nonnull final String providerExternalUuid);  }### Answer:
@Test public void getNotificationByIdWithInvalidArguments() { resetAll(); replayAll(); try { getService().getNotificationById(null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }
@Test public void getNotificationById() { final Long notificationId = 1L; final T notification = getInstance(); resetAll(); expect(getRepository().findById(eq(notificationId))).andReturn(Optional.of(notification)).once(); replayAll(); final T result = getService().getNotificationById(notificationId); assertEquals(notification, result); verifyAll(); }