public void handleMessagesRetrieved(final Account account, final Device device, final String userAgent) {
    pushNotificationScheduler.cancelScheduledNotifications(account, device).whenComplete(logErrors());
  }
@Test
  void testHandleMessagesRetrieved() {
    final UUID accountIdentifier = UUID.randomUUID();
    final Account account = mock(Account.class);
    final Device device = mock(Device.class);
    final String userAgent = HttpHeaders.USER_AGENT;

    when(account.getUuid()).thenReturn(accountIdentifier);
    when(device.getId()).thenReturn(Device.PRIMARY_ID);

    when(pushNotificationScheduler.cancelScheduledNotifications(account, device))
        .thenReturn(CompletableFuture.completedFuture(null));

    pushNotificationManager.handleMessagesRetrieved(account, device, userAgent);

    verify(pushNotificationScheduler).cancelScheduledNotifications(account, device);
  }