public static int[] roundRobinPart(int objectCount, int count, int index) {
        if (objectCount < 0 || index < 0 || count < 1 || index >= count) {
            throw new IllegalArgumentException("objectCount=" + objectCount + ", count=" + count + ", index=" + index);
        }

        int[] res = new int[objectCount / count + (objectCount % count > index ? 1 : 0)];
        for (int i = 0, j = index; j < objectCount; i++, j += count) {
            res[i] = j;
        }
        return res;
    }
@Test
    public void test_roundRobinPart() {
        assertArrayEquals(new int[] {},
                roundRobinPart(0, 2, 0));
        assertArrayEquals(new int[] {0},
                roundRobinPart(1, 1, 0));
        assertArrayEquals(new int[] {0},
                roundRobinPart(1, 2, 0));
        assertArrayEquals(new int[] {},
                roundRobinPart(1, 2, 1));
        assertArrayEquals(new int[] {0, 1},
                roundRobinPart(2, 1, 0));
        assertArrayEquals(new int[] {0},
                roundRobinPart(2, 2, 0));
        assertArrayEquals(new int[] {1},
                roundRobinPart(2, 2, 1));
        assertArrayEquals(new int[] {0, 2},
                roundRobinPart(3, 2, 0));
        assertArrayEquals(new int[] {1},
                roundRobinPart(3, 2, 1));
    }