Distinct implements CombinerAggregator<Set<Integer>> { @Override public Set<Integer> init(TridentTuple tuple) { LOG.debug("get tuple: " + tuple); Set<Integer> singleton = new HashSet<Integer>(); singleton.add(tuple.getInteger(1)); return singleton; }  @Override Set<Integer> init(TridentTuple tuple); @Override Set<Integer> combine(Set<Integer> val1, Set<Integer> val2); @Override Set<Integer> zero();  }
@Test public void testInit() throws Exception { TridentTuple tuple = mock(TridentTuple.class); when(tuple.getInteger(1)).thenReturn(1); Set<Integer> init = distinct.init(tuple); assertThat(init) .isNotNull() .hasSize(1) .contains(1); }