Distinct implements CombinerAggregator<Set<Integer>> { @Override public Set<Integer> combine(Set<Integer> val1, Set<Integer> val2) { Set<Integer> union = new HashSet<Integer>(); union.addAll(val1); union.addAll(val2); return union; }  @Override Set<Integer> init(TridentTuple tuple); @Override Set<Integer> combine(Set<Integer> val1, Set<Integer> val2); @Override Set<Integer> zero();  }
@Test public void testCombine() throws Exception { Set<Integer> combined = distinct.combine(ANY_INT_SET_ONE, ANY_INT_SET_TWO); assertThat(combined) .isNotNull() .hasSize(4) .contains(1, 2, 3, 4); }