Optional<Object> (List<Object> list) { Optional<Object> first = list.stream().filter(obj -> obj instanceof String).findFirst(); return fir<caret>st.isPresent() ? Optional.of(first.get()) : Optional.empty(); }