CollectorMutability
WARNING
FragileCode
Summary
Avoid
Collectors.to{List,Map,Set}
in favour of alternatives that emphasize (im)mutability
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("CollectorMutability")
to the enclosing element.Disable this pattern completely by adding
-Xep:CollectorMutability:OFF
as compiler argument. Learn more.