public static List<PeerId> generatePriorityPeers(final int n, final List<Integer> priorities) {
        List<PeerId> ret = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            Endpoint endpoint = new Endpoint(getMyIp(), INIT_PORT + i);
            PeerId peerId = new PeerId(endpoint, 0, priorities.get(i));
            ret.add(peerId);
        }
        return ret;
    }
Test helper

@author boyan (boyan@alibaba-inc.com)

        2018-Apr-11 10:16:07 AM
jraft-extension/bdb-log-storage-impl/src/test/java/com/alipay/sofa/jraft/test/TestUtils.java