I have a Map. Let's say
Map<Long, List<MyObj>>
I want to create a long array where of all MyObj where the key (long) is found in another set()
anotherSet.contains(long)
using java stream.
I tried
map.entrySet()
.stream()
.filter(e->anotherSet(e.getKey()))
.flatMap(e.getValue)
.collect(Collectors.toList);
But it doesnt even compile