I want to take a stream of strings and turn it into a stream of word pairs. eg:
I have: { \"A\", \"Apple\", \"B\", \"Banana\", \"C\", \"Carrot\" }
{ \"A\", \"Apple\", \"B\", \"Banana\", \"C\", \"Carrot\" }
Here's a minimal amount of code that creates a List> of the pairs:
List>
List> pairs = new LinkedList<>(); testing.reduce((a, b)-> {pairs.add(Arrays.asList(a,b)); return b;});