public Node removeNode(final Endpoint addr) {
        Node ret = null;
        this.lock.lock();
        try {
            for (int i = 0; i < this.nodes.size(); i++) {
                if (this.nodes.get(i).getNodeId().getPeerId().getEndpoint().equals(addr)) {
                    ret = this.nodes.remove(i);
                    this.fsms.remove(ret.getNodeId().getPeerId());
                    break;
                }
            }
        } finally {
            this.lock.unlock();
        }
        return ret;
    }
Ensure all peers leader is expectAddr
@param expectAddr expected address
@throws InterruptedException if interrupted
jraft-extension/java-log-storage-impl/src/test/java/com/alipay/sofa/jraft/core/TestCluster.java