// "Fuse HashSet into the Stream API chain" "true-preview" import java.util.*; import java.util.stream.*; class X { void foo(Stream s) { Set set = new HashSet<>(s.collect(Collectors.toSet())); } }