NamedCountersAccumulableParam implements AccumulableParam<NamedCounters, Tuple2<String,Long>> { @Override public NamedCounters zero(NamedCounters initialCounters) { return initialCounters; }  @Override NamedCounters addAccumulator(NamedCounters counters, Tuple2<String, Long> incrementValue); @Override NamedCounters addInPlace(NamedCounters counters1, NamedCounters counters2); @Override NamedCounters zero(NamedCounters initialCounters);  }
@Test public void zero() { NamedCounters retNamedCounters = countersAccumulableParam.zero(namedCounters1); assertTrue(retNamedCounters == namedCounters1); assertThat(retNamedCounters.counterNames(), containsInAnyOrder(counterName1, counterName2)); assertThat(retNamedCounters.currentValue(counterName1), is(3L)); assertThat(retNamedCounters.currentValue(counterName2), is(1L)); }