1 import java.util.*; 2 import java.util.stream.*; 3 4 public interface Java8Example { 5 6 default void hello() { 7 List<String> words = Arrays.asList("Hello", "World", "hi"); 8 System.out.println(words); 9 10 List<String> words2 = words.stream().filter((String s) -> s.length() > 2).collect(Collectors.<String> toList()); 11 System.out.println(words2); 12 } 13 } 14