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

        return Stream.of(checkUpdate(last, current, keyExtractor, versionExtractor),
                checkNoUpdate(last, current, keyExtractor, versionExtractor),
                checkNew(last, current, keyExtractor))
                .flatMap(Collection::stream)
                .collect(Collectors.toList());
    }
Check and return list of elements which are the latest version by compare the version

@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 are the latest ones
@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