public CompletableFuture<Void> scheduleDelayedNotification(final Account account, final Device device, final Duration minDelay) {
    return pushSchedulingCluster.withCluster(connection ->
        connection.async().zadd(getDelayedNotificationQueueKey(account, device),
            clock.instant().plus(minDelay).toEpochMilli(),
            encodeAciAndDeviceId(account, device)))
        .thenRun(() -> Metrics.counter(DELAYED_NOTIFICATION_SCHEDULED_COUNTER_NAME,
                TOKEN_TYPE_TAG, getTokenType(device))
            .increment())
        .toCompletableFuture();
  }
@Test
  void testScheduleDelayedNotification() {
    clock.pin(Instant.now());

    assertEquals(Optional.empty(),
        pushNotificationScheduler.getNextScheduledDelayedNotificationTimestamp(account, device));

    pushNotificationScheduler.scheduleDelayedNotification(account, device, Duration.ofMinutes(1)).join();

    assertEquals(Optional.of(clock.instant().truncatedTo(ChronoUnit.MILLIS).plus(Duration.ofMinutes(1))),
        pushNotificationScheduler.getNextScheduledDelayedNotificationTimestamp(account, device));

    pushNotificationScheduler.scheduleDelayedNotification(account, device, Duration.ofMinutes(2)).join();

    assertEquals(Optional.of(clock.instant().truncatedTo(ChronoUnit.MILLIS).plus(Duration.ofMinutes(2))),
        pushNotificationScheduler.getNextScheduledDelayedNotificationTimestamp(account, device));
  }