SyntaxFix
Write A Post
Hire A Developer
Questions
An alternative, more verbose way
List<SomeObject> toRemove = new ArrayList<SomeObject>(); for (SomeObject key: map.keySet()) { if (something) { toRemove.add(key); } } for (SomeObject key: toRemove) { map.remove(key); }