Suppress false positives by adding the suppression annotation @SuppressWarnings("CollectorShouldNotUseState") to the enclosing element.
@SuppressWarnings("CollectorShouldNotUseState")