static Comparator<ReplicaView> comparator() {
        return Comparator.comparingLong(ReplicaView::logEndOffset)
            .thenComparing(Comparator.comparingLong(ReplicaView::timeSinceLastCaughtUpMs).reversed())
            .thenComparing(replicaInfo -> replicaInfo.endpoint().id());
    }
Comparator for ReplicaView that returns in the order of "most caught up". This is used for deterministic
selection of a replica when there is a tie from a selector.
clients/src/main/java/org/apache/kafka/common/replica/ReplicaView.java