public boolean stop(final Endpoint listenAddr) throws InterruptedException {
        final Node node = removeNode(listenAddr);
        final CountDownLatch latch = new CountDownLatch(1);
        if (node != null) {
            node.shutdown(new ExpectClosure(latch));
            node.join();
            latch.await();
        }
        final RaftGroupService raftGroupService = this.serverMap.remove(listenAddr.toString());
        raftGroupService.shutdown();
        raftGroupService.join();
        return node != null;
    }
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