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