### Question:
PluginStats { public long getMaxTime() { return maxTime.getAndSet(0); } private  PluginStats(); static PluginStats getInstance(); void incrementRequestCount(); void addRequestTime(long time); long getRequestCount(); long getRequestTime(); long getMaxTime();  }### Answer:
@Test public void testMaxRequestTime() throws Exception { List<Callable<Long>> generators = new ArrayList<Callable<Long>>(); for (int i = 0; i < 4; i++) { generators.add(newRequestTimeGenerator()); } List<Future<Long>> maxByGeneratorFutures = executorService.invokeAll(generators); List<Long> maxByGenerators = new ArrayList<Long>(); for (Future<Long> maxByGeneratorFuture : maxByGeneratorFutures) { maxByGenerators.add(maxByGeneratorFuture.get(5, TimeUnit.MINUTES)); } Collections.sort(maxByGenerators, Collections.reverseOrder()); Long expectedMaxTime = maxByGenerators.get(0); assertEquals(expectedMaxTime, Long.valueOf(pluginStats.getMaxTime()), maxByGenerators.toString()); assertEquals(0, pluginStats.getMaxTime(), "max time stat should have been reset to 0"); }