public static int[] copyWithout(int[] replicas, int[] values) {
        int size = 0;
        for (int replica : replicas) {
            if (!Replicas.contains(values, replica)) {
                size++;
            }
        }
        int[] result = new int[size];
        int j = 0;
        for (int replica : replicas) {
            if (!Replicas.contains(values, replica)) {
                result[j++] = replica;
            }
        }
        return result;
    }
Copy a replica array without any occurrences of the given values.

@param replicas      The replica array.
@param values        The values to filter out.

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