public static int[] copyWith(int[] replicas, int value) {
        int[] newReplicas = new int[replicas.length + 1];
        System.arraycopy(replicas, 0, newReplicas, 0, replicas.length);
        newReplicas[newReplicas.length - 1] = value;
        return newReplicas;
    }
Copy a replica array with the given value.

@param replicas      The replica array.
@param value         The value to add.

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