Class ListUtil

    • Method Detail

      • mergeNullableLists

        @SafeVarargs
        public static <T> List<T> mergeNullableLists​(List<T>... lists)
        Combines the lists passed into a new list, excluding any null lists given. If the resulting list is empty, return null. This method is marked with @SafeVarargs because the elements of the lists handled generically and the input/output types match.
        Type Parameters:
        T - element type of the list
        Parameters:
        lists - one or more lists to combine
        Returns:
        the combined/merged lists or null if the resulting merged list is empty