Number (Optional<MyList> strList) { if(strList.isPres<caret>ent()) { /* optional is present */ return /*return something */ strList.get().size() > /*too big*/ 1 ? strList.get().get(1) : 1.0; } else { /* optional is absent */ return /* return null*/ null; } }