In the following example we have Java 8 Optionals, which could be empty due to the filter().
However, SonarLint highlights semicolon.isPresent() and comment.isPresent() as always being true. This is not the case, since line.indexOf() could return -1 which gets filtered out.