public static <T> List<List<T>> partitionList(List<T> originList, int size) {

        List<List<T>> resultList = new ArrayList<>();
        if (null == originList || 0 == originList.size() || size <= 0) {
            return resultList;
        }
        if (originList.size() <= size) {
            for (T item : originList) {
                List<T> resultItemList = new ArrayList<>();
                resultItemList.add(item);
                resultList.add(resultItemList);
            }
            for (int i = 0; i < (size - originList.size()); i++) {
                resultList.add(new ArrayList<>());
            }
            return resultList;
        }

        for (int i = 0; i < size; i++) {
            resultList.add(new ArrayList<>());
        }
        int count = 0;
        for (T item : originList) {
            int index = count % size;
            resultList.get(index).add(item);
            count++;
        }
        return resultList;
    }
@Test
    void partitionList() {
        List<Integer> list = asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        List<List<Integer>> lists = ListPartition.partitionList(list, 3);
        assertThat(lists)
                .satisfies(
                        s -> {
                            assertThat(s).hasSize(3);
                            assertThat(s.get(0)).isEqualTo(asList(1, 4, 7, 10));
                            assertThat(s.get(1)).isEqualTo(asList(2, 5, 8));
                            assertThat(s.get(2)).isEqualTo(asList(3, 6, 9));
                        });
    }