@Override
    public Result reconcile(Request request) {
        client.fetch(Comment.class, request.name())
            .ifPresent(comment -> {
                if (isDeleted(comment)) {
                    if (removeFinalizers(comment.getMetadata(), Set.of(FINALIZER_NAME))) {
                        cleanUpResources(comment);
                        client.update(comment);
                    }
                    return;
                }
                if (addFinalizers(comment.getMetadata(), Set.of(FINALIZER_NAME))) {
                    replyNotificationSubscriptionHelper.subscribeNewReplyReasonForComment(comment);
                    client.update(comment);
                    eventPublisher.publishEvent(new CommentCreatedEvent(this, comment));
                }

                compatibleCreationTime(comment);
                Comment.CommentStatus status = comment.getStatusOrDefault();
                status.setHasNewReply(defaultIfNull(status.getUnreadReplyCount(), 0) > 0);

                updateUnReplyCountIfNecessary(comment);
                updateSameSubjectRefCommentCounter(comment);

                // version + 1 is required to truly equal version
                // as a version will be incremented after the update
                comment.getStatusOrDefault()
                    .setObservedVersion(comment.getMetadata().getVersion() + 1);

                client.update(comment);
            });
        return new Result(false, null);
    }
@Test
    void reconcileDelete() {
        Comment comment = new Comment();
        comment.setMetadata(new Metadata());
        comment.getMetadata().setName("test");
        comment.getMetadata().setDeletionTimestamp(Instant.now());
        Set<String> finalizers = new HashSet<>();
        finalizers.add(CommentReconciler.FINALIZER_NAME);
        comment.getMetadata().setFinalizers(finalizers);
        comment.setSpec(new Comment.CommentSpec());
        comment.getSpec().setSubjectRef(getRef());
        comment.getSpec().setLastReadTime(now.plusSeconds(5));
        comment.setStatus(new Comment.CommentStatus());

        when(client.fetch(eq(Comment.class), eq("test")))
            .thenReturn(Optional.of(comment));

        when(replyService.removeAllByComment(eq(comment.getMetadata().getName())))
            .thenReturn(Mono.empty());
        when(client.listBy(eq(Comment.class), any(ListOptions.class), isA(PageRequest.class)))
            .thenReturn(ListResult.emptyResult());

        Reconciler.Result reconcile = commentReconciler.reconcile(new Reconciler.Request("test"));
        assertThat(reconcile.reEnqueue()).isFalse();
        assertThat(reconcile.retryAfter()).isNull();

        verify(replyService).removeAllByComment(eq(comment.getMetadata().getName()));

        ArgumentCaptor<Comment> captor = ArgumentCaptor.forClass(Comment.class);
        verify(client, times(1)).update(captor.capture());
        Comment value = captor.getValue();
        assertThat(value.getMetadata().getFinalizers()
            .contains(CommentReconciler.FINALIZER_NAME)).isFalse();
    }