Hi,
See the following ArrayList:
List<Integer> values = new ArrayList<Integer>();
values.add(0);
values.add(1);
values.add(2);
values.add(3);
values.add(4);
values.add(5);
values.add(6);
So we have:
integerList.size(); // outputs 7 elements
I need to show a Google chart as follows:
To generate its values, I just call
StringUtils.join(values, ","); // outputs 0,1,2,3,4,5,6
It happens it supports up to 1000 pixel width. So if I have many values, I need to split my ArrayList into other ArrayLists to generate other charts. Something like:
Integer targetSize = 3; // And suppose each target ArrayList has size equal to 3
// ANSWER GOES HERE
List<List<Integer>> output = SomeHelper.split(values, targetSize);
What Helper should I use to get my goal?