@Test
public void reportsTasksInformationForRunnable() throws Exception {

    assertThat(submitted.getCount()).isEqualTo(0);
    assertThat(running.getCount()).isEqualTo(0);
    assertThat(completed.getCount()).isEqualTo(0);
    assertThat(duration.getCount()).isEqualTo(0);
    assertThat(idle.getCount()).isEqualTo(0);
    Runnable runnable = () -> {
        assertThat(submitted.getCount()).isEqualTo(1);
        assertThat(running.getCount()).isEqualTo(1);
        assertThat(completed.getCount()).isEqualTo(0);
        assertThat(duration.getCount()).isEqualTo(0);
        assertThat(idle.getCount()).isEqualTo(1);
    };
    Future<?> theFuture = instrumentedExecutorService.submit(runnable);
    theFuture.get();
    assertThat(submitted.getCount()).isEqualTo(1);
    assertThat(running.getCount()).isEqualTo(0);
    assertThat(completed.getCount()).isEqualTo(1);
    assertThat(duration.getCount()).isEqualTo(1);
    assertThat(duration.getSnapshot().size()).isEqualTo(1);
    assertThat(idle.getCount()).isEqualTo(1);
    assertThat(idle.getSnapshot().size()).isEqualTo(1);
}