If you have a large collection and you may want to break the elements of the list in batches or chuncks for further processing. This example we will show how to partition a list into sublists using groovy. In a groovy listcollate() exists to split a list into sub-lists of a specified size. This feature also exists for collections and iterables. There are various overloaded methods so be sure to look into the documentation. In a comparable example we demonstrate how to split an arraylist into sublists in java.