我在Java中有最終的ConcurrentMap,並且想要過濾它的元素而不創建新的元素。在lambda中過濾Java集合w/o創建新集合
問題是:我可以參考集合(人)從lambda?
final ConcurrentMap<String, String> people = new ConcurrentHashMap<>();
people.put("Sam", "developer");
people.put("Kate", "tester");
people.forEach((name, role) -> {
if (name.length() > 3)
people.remove(name);
});