public static <T, R, N extends Comparable<? super N>> List<T> checkUpdate(
            List<T> last, List<T> current,
            Function<T, R> keyExtractor,
            Function<T, N> versionExtractor) {

        List<R> intersection = ListUtil.intersectionKey(last, current, keyExtractor);
        Map<R, T> lastMap = ListUtil.toMap(last, keyExtractor);
        Map<R, T> currentMap = ListUtil.toMap(current, keyExtractor);

        return intersection.stream()
                .map(key -> {
                    T lastElement = lastMap.get(key);
                    T currentElement = currentMap.get(key);
                    Comparator<T> comparator = Comparator.comparing(versionExtractor);
                    return comparator.compare(lastElement, currentElement) < 0 ? currentElement : null;
                })
                .filter(Objects::nonNull)
                .collect(Collectors.toList());
    }
Check and return list of elements which have been updated by compare the specified key

@param last Last elements list
@param current Current elements list
@param keyExtractor Map key extract function
@param versionExtractor Compare key extractor
@return List of elements which have been updated by compare the specified key
@param <T> Element type
@param <R> Map key type
@param <N> Compare key type
inlong-common/src/main/java/org/apache/inlong/common/util/SortConfigUtil.java