Filtering distinct elements using Java 8 streams

This is NOT the official website
of Java.
List<String> words = Arrays.asList("hello", "cool", "Java8", "world!");["hello","cool","Java8","world!"]
 
List<Integer> lengths = words.stream()
        .map(String::length)
        .distinct()
        .collect(Collectors.toList());[5,4,6]