Optional<String> (List<Object> objects) { Optional<String> result = Optional.empty(); for(Object obj : obj<caret>ects) { if(obj instanceof String) { result = trim((String)obj); break; } } return result; }