void (Optional<String> str) { String val; if (<warning descr="Can be replaced with single expression in functional style">str.isPresent()</warning>) { val = str.get(); } else { val = ""; } System.out.println(val); }