java-8 filter a list without creating a new list

前端 未结 1 526
一个人的身影
一个人的身影 2021-02-07 04:27

I\'m looking for the cleanest way to filter a list in Java-8, with a simple lambda Predicate, without creating a new list.

In particular, t

相关标签:
1条回答
  • 2021-02-07 04:53
    beerDrinkers.removeIf(p -> p.getAge() <= 16);
    
    0 讨论(0)
提交回复
热议问题