I have two list and i want filter thoose elements which are both list contains. And i want to do this with lambda expression.
Users getName and Clients getUserName b
Look this:
List result = clients .stream() .filter(c -> (users.stream().map(User::getName).collect(Collectors.toList())).contains(c.getName())) .collect(Collectors.toList());