// "Fix all 'Optional.get() is called without isPresent() check' problems in file" "true" import java.util.Optional; class Test { class PropertyHolder { T property; Optional getProperty() { return Optional.ofNullable(property); } Optional getProperty(String s) { return Optional.ofNullable(property); } Optional getPropertyEx() throws Exception { return Optional.ofNullable(property); } } class Smth { PropertyHolder propertyHolder; Optional> getPropertyHolder() { return Optional.ofNullable(propertyHolder); } Optional> getPropertyHolderEx() throws Exception { return Optional.ofNullable(propertyHolder); } } void test() throws Exception { Optional property = new Smth().getPropertyHolder().flatMap(PropertyHolder::getProperty); Optional property1 = new Smth().getPropertyHolderEx().flatMap(propertyHolderEx -> propertyHolderEx.getProperty("foo")); Optional property2 = new Smth().getPropertyHolderEx().get().getPropertyEx(); } }