I have Stream<SortedSet<String>>
, and I want to have just a Stream<String>
. I tried using flatMap()
but it did not work since it cannot flat Stream of Sortedset.
String productName = "p1";
Set<Product> products = new HashSet<>();
products.add(new Product(productName));
Stream<SortedSet<String>> sortedSetStream = products.stream().map(p -> Util.getProductNames(p) );