public static <T> List<List<T>> splitBySize(List<T> list, int expectedSize)
            throws NullPointerException, IllegalArgumentException {
        Preconditions.checkNotNull(list, "list must not be null");
        Preconditions.checkArgument(expectedSize > 0, "expectedSize must larger than 0");

        if (1 == expectedSize) {
            return Collections.singletonList(list);
        }

        int splitSize = Math.min(expectedSize, list.size());

        List<List<T>> result = new ArrayList<List<T>>(splitSize);
        for (int i = 0; i < splitSize; i++) {
            result.add(new ArrayList<>());
        }

        int index = 0;
        for (T t : list) {
            result.get(index).add(t);
            index = (index + 1) % splitSize;
        }

        return result;
    }
@Test
    public void testSplitBySizeWithNegativeSize() {
        List<Integer> lists = Lists.newArrayList(1, 2, 3);
        int expectSize = -1;

        expectedEx.expect(IllegalArgumentException.class);
        expectedEx.expectMessage("expectedSize must larger than 0");

        ListUtil.splitBySize(lists, expectSize);
    }