public static MetricRegistry getOrCreate(String name, boolean enabled) {
   final MetricRegistry existing = REGISTRIES.get(name);
   if (existing == null) {
     final MetricRegistry created = MetricsFactory.getMetricRegistry(enabled);
     final MetricRegistry raced = add(name, created);
     if (raced == null) {
       return created;
     }
     return raced;
   }
   return existing;
 }
 @Test
 public void hasReporters() throws Exception {
   CsvReporterFactory csvReporter = new CsvReporterFactory();
   csvReporter.setFile(new File("metrics.csv"));
   assertThat(config.getReporters()).hasSize(3);
 }
 @Test
 public void hasADefaultFrequency() throws Exception {
   assertThat(config.getFrequency()).isEqualTo(Duration.seconds(10));
 }