I have a set let's suppose with 10 unique elements
Set<String> myset =new HashSet<String>();
[a,b,c,d,e,f,g,h,i,j]
I wish to construct a List<Set<String>> such that each element of the list contains a set of size 2.
List<Set<String>> myList = new ArrayList<Set<String>>();
[
[a,b],
[c,d],
[e,f],
[g,h],
[i,j]
]
How do I implement it using stream in java?