Guest User

Untitled

a guest
Jan 21st, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. List<Integer> input = Arrays.asList(1, 2, 3, 4, 2, 4, 5, 8, 2);
  2. List<Integer> result = input
  3. .stream()
  4. .filter(x -> input.stream().filter(x::equals).count() > 1)
  5. .distinct()
  6. .collect(Collectors.toList());
Add Comment
Please, Sign In to add comment