I'm wondering if there is any nice a way using Java 8 to do something like this:
int amount = 1000;
int firstIndex = 0;
int lastIndex = firstIndex + amount;
List<int> projectIdsList;
while (lastIndex < projectIdsList.size()){
doSomethingWhitSubList(projectIdsList.subList(firstIndex, lastIndex));
firstIndex = lastIndex;
lastIndex = firstIndex + amount;
}
doSomethingWhitSubList(projectIdsList.subList(firstIndex, projectIdsList.size());