Class CollectionUtil


  • public class CollectionUtil
    extends Object
    Some utility methods to handle collections.
    Since:
    8.2.1
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • CollectionUtil

        public CollectionUtil()
    • Method Detail

      • main

        public static void main​(String[] args)
      • partition

        public static <T> Collection<List<T>> partition​(List<T> list,
                                                        int size)
        Divide a list to segments of n size
        Type Parameters:
        T - the type of elements in list
        Parameters:
        list - the collection to process
        size - number of elements in each segment
        Returns:
        the collection of segments