docs: public boolean removeMember(long commitIndex, CPMemberInfo leavingMember) {
          checkNotNull(leavingMember);
          checkMetadataGroupInitSuccessful();
  
          if (!activeMembers.contains(leavingMember)) {
              logger.fine("Not removing " + leavingMember + " since it is not an active CP member");
              return true;
          }
  
          if (membershipChangeSchedule != null) {
              if (leavingMember.equals(membershipChangeSchedule.getLeavingMember())) {
                  membershipChangeSchedule = membershipChangeSchedule.addRetriedCommitIndex(commitIndex);
  
                  if (logger.isFineEnabled()) {
                      logger.fine(leavingMember + " is already marked as leaving.");
                  }
  
                  return false;
              }
  
              String msg = "There is already an ongoing CP membership change process. " + "Cannot process remove request of "
                      + leavingMember;
  
              if (logger.isFineEnabled()) {
                  logger.fine(msg);
              }
  
              throw new CannotRemoveCPMemberException(msg);
          }
  
          if (activeMembers.size() == 2) {
              // There are two CP members.
              // If this operation is committed, it means both CP members have appended this operation.
              // I am returning a retry response, so that leavingMember will retry and commit this operation again.
              // Commit of its retry will ensure that both CP members' activeMember.size() == 1,
              // so that they will complete their shutdown in RaftService.ensureCPMemberRemoved()
              logger.warning(leavingMember + " is directly removed as there are only " + activeMembers.size() + " CP members.");
              removeActiveMember(commitIndex, leavingMember);
              throw new RetryableHazelcastException();
          } else if (activeMembers.size() == 1) {
              // This is the last CP member. It is not removed from the active CP members list
              // so that it will complete its shutdown in RaftService.ensureCPMemberRemoved()
              logger.fine("Not removing the last active CP member: " + leavingMember + " to help it complete its shutdown");
              return true;
          }
  
          return initMembershipChangeScheduleForLeavingMember(commitIndex, leavingMember);
      }