com.nls.util.ListUtil Maven / Gradle / Ivy
package com.nls.util;
import java.util.Collection;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public final class ListUtil {
private ListUtil() {
}
public static List map(Collection collection, Function mapper) {
return map(collection.stream(), mapper);
}
public static List map(Stream stream, Function mapper) {
return stream.map(mapper).collect(Collectors.toList());
}
}