@Override
  public void accept(TimerEvent timerEvent) {
    logMessageConsumer.accept(buildLogMessage(timerEvent));
  }
@Test
  public void testAccept() {
    TimerEventHandler timerEventHandler = new TimerEventHandler(logMessageQueue::add);

    timerEventHandler.accept(
        new TimerEvent(State.START, ROOT_TIMER, Duration.ZERO, Duration.ZERO, "description"));
    timerEventHandler.accept(
        new TimerEvent(State.LAP, ROOT_TIMER, Duration.ofMillis(10), Duration.ZERO, "description"));
    timerEventHandler.accept(
        new TimerEvent(
            State.FINISHED, ROOT_TIMER, Duration.ofMillis(100), Duration.ZERO, "description"));

    timerEventHandler.accept(
        new TimerEvent(
            State.LAP,
            () -> Optional.of(ROOT_TIMER),
            Duration.ZERO,
            Duration.ZERO,
            "child description"));

    String rootStartMessage = logMessageQueue.poll();
    Assert.assertNotNull(rootStartMessage);
    Assert.assertEquals("TIMING\tdescription", rootStartMessage);

    String rootInProgressMessage = logMessageQueue.poll();
    Assert.assertNotNull(rootInProgressMessage);
    Assert.assertEquals("TIMED\tdescription : 10.0 ms", rootInProgressMessage);

    String rootFinishedMessage = logMessageQueue.poll();
    Assert.assertNotNull(rootFinishedMessage);
    Assert.assertEquals("TIMED\tdescription : 100.0 ms", rootFinishedMessage);

    String childMessage = logMessageQueue.poll();
    Assert.assertNotNull(childMessage);
    Assert.assertEquals("\tTIMED\tchild description : 0.0 ms", childMessage);

    Assert.assertTrue(logMessageQueue.isEmpty());
  }