OpenTsdbReporterProvider implements Provider<OpenTsdbReporter> { @Override public OpenTsdbReporter get() { return OpenTsdbReporter.forRegistry(metricRegistry) .prefixedWith(configuration.getPrefix()) .convertDurationsTo(configuration.getUnitDurations()) .convertRatesTo(configuration.getUnitRates()) .withBatchSize(configuration.getBatchSize()) .withCounterGaugeDecorations(configuration.isCounterGaugeDecorations()) .withTags(configuration.getTags()) .filter(new RegexMetricFilter(configuration.getIncludeMetrics())) .build(openTsdb); } @Inject  OpenTsdbReporterProvider(MetricsOpenTsdbReporterConfiguration configuration,
                                    OpenTsdb openTsdb,
                                    MetricRegistry metricRegistry); @Override OpenTsdbReporter get();  }
@Test public void get() throws Exception { final MetricsOpenTsdbReporterConfiguration configuration = new MetricsOpenTsdbReporterConfiguration(); final OpenTsdb openTsdb = OpenTsdb.forService("http: final OpenTsdbReporterProvider provider = new OpenTsdbReporterProvider(configuration, openTsdb, new MetricRegistry()); final OpenTsdbReporter reporter = provider.get(); assertNotNull(reporter); }