public static <T, R> Map<R, T> toMap(List<T> list, Function<T, R> keyExtractor) {
        if (CollectionUtils.isEmpty(list)) {
            return new HashMap<>();
        }
        return list.stream().collect(Collectors.toMap(keyExtractor, v -> v));
    }
Convert a list to map
@param list
@param keyExtractor Map key extractor
@return Map
@param <T> Elements type
@param <R> Key type
inlong-common/src/main/java/org/apache/inlong/common/util/ListUtil.java