GraphiteReporterProvider implements Provider<GraphiteReporter> { @Override public GraphiteReporter get() { return GraphiteReporter.forRegistry(metricRegistry) .prefixedWith(configuration.getPrefix()) .convertRatesTo(configuration.getUnitRates()) .convertDurationsTo(configuration.getUnitDurations()) .filter(new RegexMetricFilter(configuration.getIncludeMetrics())) .build(graphiteSender); } @Inject  GraphiteReporterProvider(MetricsGraphiteReporterConfiguration configuration,
                                    GraphiteSender graphiteSender,
                                    MetricRegistry metricRegistry); @Override GraphiteReporter get();  }
@Test public void get() throws Exception { final MetricsGraphiteReporterConfiguration configuration = new MetricsGraphiteReporterConfiguration(); final GraphiteSender graphiteSender = new GraphiteUDP("127.0.0.1", 12345); final MetricRegistry metricRegistry = new MetricRegistry(); final GraphiteReporterProvider provider = new GraphiteReporterProvider(configuration, graphiteSender, metricRegistry); final GraphiteReporter reporter = provider.get(); assertNotNull(reporter); }