StatsdReporterProvider implements Provider<StatsdReporter> { @Override public StatsdReporter get() { return StatsdReporter.forRegistry(metricRegistry) .prefixedWith(configuration.getPrefix()) .convertDurationsTo(configuration.getUnitDurations()) .convertRatesTo(configuration.getUnitRates()) .filter(new RegexMetricFilter(configuration.getIncludeMetrics())) .build(statsd); } @Inject  StatsdReporterProvider(MetricsStatsdReporterConfiguration configuration, Statsd statsd, MetricRegistry metricRegistry); @Override StatsdReporter get();  }
@Test public void get() throws Exception { final MetricsStatsdReporterConfiguration configuration = new MetricsStatsdReporterConfiguration(); final Statsd statsd = new Statsd("127.0.0.1", 8125); final StatsdReporterProvider provider = new StatsdReporterProvider(configuration, statsd, new MetricRegistry()); final StatsdReporter reporter = provider.get(); assertNotNull(reporter); }