public static <T> Map<Integer, List<T>> distributeObjects(int count, List<T> objects) {
        Map<Integer, List<T>> processorToObjects = IntStream.range(0, objects.size())
                .mapToObj(i -> entry(i, objects.get(i)))
                .collect(groupingBy(e -> e.getKey() % count, mapping(Map.Entry::getValue, Collectors.toList())));

        for (int i = 0; i < count; i++) {
            processorToObjects.putIfAbsent(i, emptyList());
        }
        return processorToObjects;
    }
@Test
    public void test_distributeObjects() {
        // count == 1
        assertArrayEquals(
                new int[][]{
                        new int[]{}},
                distributeObjects(1, new int[]{}));
        assertArrayEquals(
                new int[][]{
                        new int[]{2}},
                distributeObjects(1, new int[]{2}));
        assertArrayEquals(
                new int[][]{
                        new int[]{2, 4}},
                distributeObjects(1, new int[]{2, 4}));

        // count == 3
        assertArrayEquals(
                new int[][]{
                        new int[]{2},
                        new int[]{},
                        new int[]{}},
                distributeObjects(3, new int[]{2}));
        assertArrayEquals(
                new int[][]{
                        new int[]{2},
                        new int[]{4},
                        new int[]{6}},
                distributeObjects(3, new int[]{2, 4, 6}));
        assertArrayEquals(
                new int[][]{
                        new int[]{2, 8},
                        new int[]{4},
                        new int[]{6}},
                distributeObjects(3, new int[]{2, 4, 6, 8}));
    }