public Optional<VoterSet> voterSetAtOffset(long offset) {
        checkOffsetIsValid(offset);

        synchronized (voterSetHistory) {
            return voterSetHistory.valueAtOrBefore(offset);
        }
    }
Returns the voter set at a given offset.

@param offset the offset (inclusive)
@return the voter set if one exist, otherwise {@code Optional.empty()}
raft/src/main/java/org/apache/kafka/raft/internals/KRaftControlRecordStateMachine.java