public static int[] copyWithout(int[] replicas, int value) {
        int size = 0;
        for (int replica : replicas) {
            if (replica != value) {
                size++;
            }
        }
        int[] result = new int[size];
        int j = 0;
        for (int replica : replicas) {
            if (replica != value) {
                result[j++] = replica;
            }
        }
        return result;
    }
@Test
    public void testCopyWithout2() {
        assertArrayEquals(new int[] {}, Replicas.copyWithout(new int[] {}, new int[] {}));
        assertArrayEquals(new int[] {}, Replicas.copyWithout(new int[] {1}, new int[] {1}));
        assertArrayEquals(new int[] {1, 3},
            Replicas.copyWithout(new int[] {1, 2, 3}, new int[]{2, 4}));
        assertArrayEquals(new int[] {4},
            Replicas.copyWithout(new int[] {4, 2, 2, 1}, new int[]{2, 1}));
    }