Accumulators implements Serializable { public Map<String, LongAccumulator> getLongAccumulators() { return longAccumulators; } Accumulators(Set<AccumulatorRequest> requests); Map<String, LongAccumulator> getLongAccumulators(); Map<String, DoubleAccumulator> getDoubleAccumulators();  }
@Test public void testRequestOne() { AccumulatorRequest request = new AccumulatorRequest("hello", Long.class); Accumulators accumulators = new Accumulators(Collections.singleton(request)); LongAccumulator accumulator = accumulators.getLongAccumulators().get("hello"); assertEquals(accumulator.name().get(), "hello"); }