private static <T, R> List<T> batchCheckRecursive(
            List<T> last, List<T> current,
            Function<T, R> keyExtractor,
            BiFunction<T, T, T> singleCheckFunction) {

        List<R> intersectionKey = ListUtil.intersectionKey(last, current, keyExtractor);
        if (CollectionUtils.isEmpty(intersectionKey)) {
            return null;
        }

        Map<R, T> lastMap = ListUtil.toMap(last, keyExtractor);
        Map<R, T> currentMap = ListUtil.toMap(current, keyExtractor);
        return intersectionKey.stream()
                .map(tag -> singleCheckFunction.apply(lastMap.get(tag), currentMap.get(tag)))
                .filter(Objects::nonNull)
                .collect(Collectors.toList());
    }
Batch check and return a list of elements base on a specified check function
@param last Elements of last check
@param current Elements of current
@param keyExtractor Key extractor of elements
@param singleCheckFunction The single element check function
@return A list of elements
@param <T> Element type
@param <R> Key type
inlong-common/src/main/java/org/apache/inlong/common/util/SortConfigUtil.java