MeteredConfigurationProvider implements ConfigurationProvider { @Override public <T> T bind(String prefix, Class<T> type) { Timer.Context context = bindTimer.time(); try { return delegate.bind(this, prefix, type); } finally { context.stop(); } } MeteredConfigurationProvider(MetricRegistry metricRegistry, String metricPrefix, SimpleConfigurationProvider delegate); @Override Properties allConfigurationAsProperties(); @Override T getProperty(String key, Class<T> type); @Override T getProperty(String key, GenericTypeInterface genericType); @Override T bind(String prefix, Class<T> type);  }
@Test void bindCallsDelegate() { ConfigPojo configPojo = new ConfigPojo() { }; when(delegate.bind(any(ConfigurationProvider.class), eq(""), eq(ConfigPojo.class))).thenReturn(configPojo); assertThat(provider.bind("", ConfigPojo.class)).isEqualTo(configPojo); }