CloudWatchReporterProvider implements Provider<CloudWatchReporter> { @Override public CloudWatchReporter get() { final AmazonCloudWatchAsyncClientBuilder amazonCloudWatchAsyncBuilder = AmazonCloudWatchAsyncClientBuilder.standard(); return new CloudWatchReporterBuilder() .withClient(amazonCloudWatchAsyncBuilder.withRegion(configuration.getRegion()).build()) .withNamespace(configuration.getNamespace()) .withTimestampLocal(configuration.getTimestampLocal()) .withDimensions(configuration.getDimensions()) .withFilter(new RegexMetricFilter(configuration.getIncludeMetrics())) .withRegistry(metricRegistry) .build(); } @Inject  CloudWatchReporterProvider(MetricsCloudWatchReporterConfiguration configuration,
                                         MetricRegistry metricRegistry); @Override CloudWatchReporter get();  }
@Test public void get() throws Exception { final MetricsCloudWatchReporterConfiguration configuration = new MetricsCloudWatchReporterConfiguration(); final CloudWatchReporterProvider provider = new CloudWatchReporterProvider(configuration, new MetricRegistry()); final CloudWatchReporter reporter = provider.get(); assertNotNull(reporter); }