code: private void updateCommitted() {
  
      List<Long> sorted = newArrayList();
  
      for (ReplicaManager manager : managers.values()) {
        sorted.add(manager.getMatchIndex());
      }
  
      sorted.add(getLog().lastLogIndex());
      Collections.sort(sorted);
  
      int n = sorted.size();
      int quorumSize = (n / 2) + 1;
      final long committed = sorted.get(quorumSize - 1);
  
      LOGGER.debug("updating commitIndex to {}; sorted is {}", committed, sorted);
      getLog().commitIndex(committed);
  
    }
docs: Find the median value of the list of matchIndex, this value is the committedIndex since, by definition, half of the
  matchIndex values are greater and half are less than this value. So, at least half of the replicas have stored the
  median value, this is the definition of committed.