import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
public class StreamEx{
//过滤重复数据
public static Predicate distinctByKey (Function keyExtractor){
Map seen = new ConcurrentHashMap<>();
return t->seen.putIfAbsent(keyExtractor.apply(t),Boolean.TRUE)==null;
}
//获取重复数据
public static Predicate getdistinctByKey (Function keyExtractor){
Map seen = new ConcurrentHashMap<>();
return t->seen.putIfAbsent(keyExtractor.apply(t),Boolean.TRUE)!=null;
}
public static void main(String[] args) {
List list = new ArrayList();
Map map1 = new HashMap();