MeteredReloadable implements Reloadable { @Override public void reload() { Timer.Context context = reloadTimer.time(); try { delegate.reload(); } finally { context.stop(); } } MeteredReloadable(MetricRegistry metricRegistry, String metricPrefix, Reloadable delegate); @Override void reload();  }
@Test void reloadCallsDelegate() { reloadable.reload(); verify(delegate, times(1)).reload(); }
@Test void reloadPropagatesIllegalStateExceptions() { doThrow(new IllegalStateException("")).when(delegate).reload(); assertThatThrownBy(() -> reloadable.reload()).isExactlyInstanceOf(IllegalStateException.class); }