GangliaReporterProvider implements Provider<GangliaReporter> { @Override public GangliaReporter get() { return GangliaReporter.forRegistry(metricRegistry) .prefixedWith(configuration.getPrefix()) .convertRatesTo(configuration.getUnitRates()) .convertDurationsTo(configuration.getUnitDurations()) .withDMax(configuration.getDMax()) .withTMax(configuration.getTMax()) .filter(new RegexMetricFilter(configuration.getIncludeMetrics())) .build(gMetric); } @Inject  GangliaReporterProvider(MetricsGangliaReporterConfiguration configuration,
                                   GMetric gMetric,
                                   MetricRegistry metricRegistry); @Override GangliaReporter get();  }
@Test public void get() throws Exception { final MetricsGangliaReporterConfiguration configuration = new MetricsGangliaReporterConfiguration(); final GMetric graphiteSender = new GMetric("127.0.0.1", 12345, null, 23); final MetricRegistry metricRegistry = new MetricRegistry(); final GangliaReporterProvider provider = new GangliaReporterProvider(configuration, graphiteSender, metricRegistry); final GangliaReporter reporter = provider.get(); assertNotNull(reporter); }