Tuple2<Integer, Integer> int3 = new Tuple2<Integer, Integer>(0, 3);
Tuple2<Integer, Integer> int4 = new Tuple2<Integer, Integer>(2, 4);
Tuple2<Integer, Integer> int5 = new Tuple2<Integer, Integer>(1, 5);
CoGroupedReduceInvokable<Tuple3<String, String, String>, Tuple2<Integer, Integer>, String> invokable = new CoGroupedReduceInvokable<Tuple3<String, String, String>, Tuple2<Integer, Integer>, String>(
new MyCoReduceFunction(), new FieldsKeySelector(true, false, 0),
new FieldsKeySelector(true, false, 0));
List<String> expected = Arrays.asList("word1", "1", "word2", "2", "word1word3", "3", "5",
"7");
List<String> actualList = MockCoInvokable.createAndExecute(invokable,
Arrays.asList(word1, word2, word3), Arrays.asList(int1, int2, int3, int4, int5));
assertEquals(expected, actualList);
invokable = new CoGroupedReduceInvokable<Tuple3<String, String, String>, Tuple2<Integer, Integer>, String>(
new MyCoReduceFunction(), new FieldsKeySelector(true, false, 2),
new FieldsKeySelector(true, false, 0));
expected = Arrays.asList("word1", "1", "word2", "2", "word2word3", "3", "5", "7");
actualList = MockCoInvokable.createAndExecute(invokable,
Arrays.asList(word1, word2, word3), Arrays.asList(int1, int2, int3, int4, int5));