public static Set<Integer> toSet(int[] replicas) {
        Set<Integer> result = new HashSet<>();
        for (int replica : replicas) {
            result.add(replica);
        }
        return result;
    }
Convert a replica array to a set.

@param replicas      The replica array.

@return              A new array with the given value.
metadata/src/main/java/org/apache/kafka/metadata/Replicas.java