请你解释一下,这些不同的结果。飞镖垫
然而,Java有不同的观点在线运行器
在 HashSet
和 List
的情况下,看起来removeWhere
正在收集要删除的元素,然后在最后将它们全部删除。对于LinkedHashSet
,一旦找到它们,它就会立即删除它们。 removeWhere
没有记录它的实现细节,所以我认为根据List
或Set
的内容对removeWhere
进行test
是不明智的。