### Question:
TimedStaticMethodWithNameFromElExpression { @Timed(name = "${(id -> 'timer ' += id)(TimedStaticMethodWithNameFromElExpression['ID'])}") public static void lambdaExpressionStaticTimedMethod() { }  @Timed(name = "${'timer ' += TimedStaticMethodWithNameFromElExpression.ID}") static void expressionStaticTimedMethod(); @Timed(name = "timer ${TimedStaticMethodWithNameFromElExpression.ID}") static void compositeExpressionStaticTimedMethod(); @Timed(name = "${(id -> 'timer ' += id)(TimedStaticMethodWithNameFromElExpression['ID'])}") static void lambdaExpressionStaticTimedMethod(); final static long ID; }### Answer:
@Test public void callLambdaExpressionTimedStaticMethodOnce() { TimedStaticMethodWithNameFromElExpression.lambdaExpressionStaticTimedMethod(); assertThat("Shared metric registry is not created", SharedMetricRegistries.names(), hasItem(REGISTRY_NAME)); MetricRegistry registry = SharedMetricRegistries.getOrCreate(REGISTRY_NAME); assertThat("Timer is not registered correctly", registry.getTimers(), hasKey(TIMER_NAME)); Timer timer = registry.getTimers().get(TIMER_NAME); assertThat("Timer count is incorrect", timer.getCount(), is(equalTo(TIMER_COUNT.incrementAndGet()))); }