Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/optionalToIf/beforeElseIfWithCodeBlock.java
2021-06-07 06:15:29 +00:00

14 lines
348 B
Java

// "Fix all ''Optional' can be replaced with sequence of 'if' statements' problems in file" "true"
import java.util.*;
class Test {
void statementWithIfPresentWithMultipleInstuctionsGeneratesCodeBlock(String s) {
Optional.<caret>ofNullable(s)
.ifPresent(s1 -> {
s1 = s1.trim();
System.out.println(s1);
});
}
}