Java tutorial
import java.util.Arrays; import java.util.List; import java.util.Optional; public class Main { public static void main(String[] args) { List<String> names = Arrays.asList("XML", "HTML", "Java", "Javascript", "CSS", "Static"); Optional<String> firstS = names.stream().filter(name -> name.startsWith("S")).findFirst(); System.out.println(firstS.orElse("None found")); } }