You are viewing a single comment's thread. Return to all comments →
Map<Integer, Long> testMap =a.stream() .collect(Collectors.groupingBy(Function.identity() ,HashMap::new, Collectors.counting())); return testMap.entrySet().stream().filter(es -> es.getValue().intValue()==1) .map(tm -> tm.getKey()).findFirst().orElse(null);
Seems like cookies are disabled on this browser, please enable them to open this website
Lonely Integer
You are viewing a single comment's thread. Return to all comments →