### Question:
MetricCollectors { public static double currentProductionRate() { return collectorMap.values().stream() .mapToDouble(MetricCollector::currentMessageProductionRate) .sum(); }  static void initialize(); static void cleanUp(); static String getStatsFor(final String topic, boolean isError); static void recordError(String topic); static Collection<Double> currentConsumptionRateByQuery(); static double currentProductionRate(); static double currentConsumptionRate(); static double totalMessageConsumption(); static double totalBytesConsumption(); static double currentErrorRate(); static Metrics getMetrics(); static Time getTime();  }### Answer:
@Test public void shouldAggregateStatsAcrossAllProducers() throws Exception { ProducerCollector collector1 = new ProducerCollector(); collector1.configure(ImmutableMap.of(ProducerConfig.CLIENT_ID_CONFIG, "client1")); ProducerCollector collector2 = new ProducerCollector(); collector2.configure(ImmutableMap.of(ProducerConfig.CLIENT_ID_CONFIG, "client2")); for (int i = 0; i < 500; i++) { collector1.onSend(new ProducerRecord<>(TEST_TOPIC, "key", Integer.toString(i))); collector2.onSend(new ProducerRecord<>(TEST_TOPIC + "_" + i, "key", Integer.toString(i * 100))); } assertEquals(10, Math.floor(MetricCollectors.currentProductionRate()), 0); }