public static List<Integer> toList(int[] array) {
        if (array == null) return null;
        List<Integer> list = new ArrayList<>(array.length);
        for (int i : array) {
            list.add(i);
        }
        return list;
    }
@Test
    public void testToList() {
        assertEquals(Arrays.asList(1, 2, 3, 4), Replicas.toList(new int[] {1, 2, 3, 4}));
        assertEquals(Collections.emptyList(), Replicas.toList(Replicas.NONE));
        assertEquals(Collections.singletonList(2), Replicas.toList(new int[] {2}));
    }