code: public boolean canReplicateNewEntry(Object operation) {
          if (isTerminatedOrSteppedDown()) {
              return false;
          }
  
          RaftLog log = state.log();
          long lastLogIndex = log.lastLogOrSnapshotIndex();
          long commitIndex = state.commitIndex();
          if (lastLogIndex - commitIndex >= maxUncommittedEntryCount) {
              return false;
          }
  
          if (status == TERMINATING) {
              return false;
          } else if (status == UPDATING_GROUP_MEMBER_LIST) {
              return state.lastGroupMembers().isKnownMember(getLocalMember()) && !(operation instanceof RaftGroupCmd);
          }
  
          if (operation instanceof UpdateRaftGroupMembersCmd) {
              // the leader must have committed an entry in its term to make a membership change
              // https://groups.google.com/forum/#!msg/raft-dev/t4xj6dJTP6E/d2D9LrWRza8J
  
              // last committed entry is either in the last snapshot or still in the log
              LogEntry lastCommittedEntry = commitIndex == log.snapshotIndex() ? log.snapshot() : log.getLogEntry(commitIndex);
              assert lastCommittedEntry != null;
  
              return lastCommittedEntry.term() == state.term();
          }
  
          return true;
      }
docs: Returns true if a new entry with the operation is allowed to be replicated.
  This method can be invoked only when the local Raft node is the leader.
  <p/>
  Replication is not allowed, when;
  <ul>
  <li>Node is terminating, terminated or stepped down. See {@link RaftNodeStatus}.</li>
  <li>Raft log contains max allowed uncommitted entry count.
  See {@link RaftAlgorithmConfig#getUncommittedEntryCountToRejectNewAppends()}.</li>
  <li>The operation is a {@link RaftGroupCmd} and there's an ongoing membership change in group.</li>
  <li>The operation is a membership change operation and there's no committed entry in this term yet.
  See {@link RaftIntegration#getAppendedEntryOnLeaderElection()} ()}.</li>
  </ul>