@Test @InSequence(4) public void removeMonotonicCounterFromRegistry() { assertThat("Counter is not registered correctly", registry.getCounters(), hasKey(COUNTER_NAME)); Counter counter = registry.getCounters().get(COUNTER_NAME); registry.remove(COUNTER_NAME); try { bean.monotonicCountedMethod(new Callable<Long>() { @Override public Long call() throws Exception { return null; } }); } catch (Exception cause) { assertThat(cause, is(Matchers.<Exception>instanceOf(IllegalStateException.class))); assertThat(cause.getMessage(), is(equalTo("No counter with name [" + COUNTER_NAME + "] found in registry [" + registry + "]"))); assertThat("Counter count is incorrect", counter.getCount(), is(equalTo(COUNTER_COUNT.get()))); return; } fail("No exception has been re-thrown!"); }
@Counted(name = "monotonicCountedMethod", absolute = true, monotonic = true) public T monotonicCountedMethod(Callable<T> callable) { try { return callable.call(); } catch (Exception cause) { throw new RuntimeException(cause); } }
MonotonicCountedMethodBean { @Counted(name = "monotonicCountedMethod", absolute = true, monotonic = true) public T monotonicCountedMethod(Callable<T> callable) { try { return callable.call(); } catch (Exception cause) { throw new RuntimeException(cause); } } }
MonotonicCountedMethodBean { @Counted(name = "monotonicCountedMethod", absolute = true, monotonic = true) public T monotonicCountedMethod(Callable<T> callable) { try { return callable.call(); } catch (Exception cause) { throw new RuntimeException(cause); } }  }
MonotonicCountedMethodBean { @Counted(name = "monotonicCountedMethod", absolute = true, monotonic = true) public T monotonicCountedMethod(Callable<T> callable) { try { return callable.call(); } catch (Exception cause) { throw new RuntimeException(cause); } }  @Counted(name = "monotonicCountedMethod", absolute = true, monotonic = true) T monotonicCountedMethod(Callable<T> callable); }
MonotonicCountedMethodBean { @Counted(name = "monotonicCountedMethod", absolute = true, monotonic = true) public T monotonicCountedMethod(Callable<T> callable) { try { return callable.call(); } catch (Exception cause) { throw new RuntimeException(cause); } }  @Counted(name = "monotonicCountedMethod", absolute = true, monotonic = true) T monotonicCountedMethod(Callable<T> callable);  }