public void stopAll() throws InterruptedException {
        final List<Endpoint> addrs = getAllNodes();
        final List<Node> nodes = new ArrayList<>();
        for (final Endpoint addr : addrs) {
            final Node node = removeNode(addr);
            node.shutdown();
            nodes.add(node);
            this.serverMap.remove(addr.toString()).shutdown();
        }
        for (final Node node : nodes) {
            node.join();
        }
        CLUSTERS.remove(this);
    }
Test cluster for NodeTest
@author boyan (boyan@alibaba-inc.com)

2018-Apr-20 1:41:17 PM
jraft-extension/java-log-storage-impl/src/test/java/com/alipay/sofa/jraft/core/TestCluster.java