LocalCacheMetrics implements Metrics { @Override public void collect(Stats stats) { stats.put("cache_size", cacheStore.caches.size()); } LocalCacheMetrics(LocalCacheStore cacheStore); @Override void collect(Stats stats);  }
@Test void collect() { var stats = new Stats(); metrics.collect(stats); assertThat(stats.stats) .containsEntry("cache_size", 0.0d); }