code: private long heartbeatTime() {
      int quorumIndex = quorumIndex();
      if (quorumIndex >= 0) {
        return context.getClusterState().getActiveMemberStates((m1, m2)-> Long.compare(m2.getHeartbeatTime(), m1.getHeartbeatTime())).get(quorumIndex).getHeartbeatTime();
      }
      return System.currentTimeMillis();
    }
docs: Returns the last time a majority of the cluster was contacted.
  <p>
  This is calculated by sorting the list of active members and getting the last time the majority of
  the cluster was contacted based on the index of a majority of the members. So, in a list of 3 ACTIVE
  members, index 1 (the second member) will be used to determine the commit time in a sorted members list.