public static <K, U> Map<K, List<U>> groupBy(final Collection<U> list, final Function<? super U, ? extends K> function) {
        if (CollectionUtils.isEmpty(list)) {
            return Collections.emptyMap();
        }
        return list.stream()
                .filter(Objects::nonNull)
                .collect(Collectors.groupingBy(function));
    }
list group by.<br>
if element is null it filters.

@param list     list
@param function group key fun
@param <K>      map key type
@param <U>      map value type
@return list
shenyu-common/src/main/java/org/apache/shenyu/common/utils/ListUtil.java