[Java:S3958] Falsely reports unused stream pipeline

Version used: SonarCloud
Java compiler source and target versions: 14

Simplified method with which the issue should be reproduced:

    public Stream<Double> method() {
        Stream<Double> streamOfNumbers = Stream.of(1d, 2d, 3d);
        return Optional.of(new Random().nextDouble())
                .filter(randomNumber -> randomNumber < 0.99)
                .map(randomNumber -> streamOfNumbers.map(number -> number + randomNumber))

In both cases we are returning the same stream, except in once case it gets an extra .map intermediate operation.

Actual method and FP: