@Test
public void testScheduleCallable() throws Exception {

    assertThat(submitted.getCount()).isZero();
    assertThat(running.getCount()).isZero();
    assertThat(completed.getCount()).isZero();
    assertThat(duration.getCount()).isZero();
    assertThat(scheduledOnce.getCount()).isZero();
    assertThat(scheduledRepetitively.getCount()).isZero();
    assertThat(scheduledOverrun.getCount()).isZero();
    assertThat(percentOfPeriod.getCount()).isZero();
    final Object obj = new Object();
    ScheduledFuture<Object> theFuture = instrumentedScheduledExecutor.schedule(() -> {
        assertThat(submitted.getCount()).isZero();
        assertThat(running.getCount()).isEqualTo(1);
        assertThat(completed.getCount()).isZero();
        assertThat(duration.getCount()).isZero();
        assertThat(scheduledOnce.getCount()).isEqualTo(1);
        assertThat(scheduledRepetitively.getCount()).isZero();
        assertThat(scheduledOverrun.getCount()).isZero();
        assertThat(percentOfPeriod.getCount()).isZero();
        return obj;
    }, 10L, TimeUnit.MILLISECONDS);
    assertThat(theFuture.get()).isEqualTo(obj);
    assertThat(submitted.getCount()).isZero();
    assertThat(running.getCount()).isZero();
    assertThat(completed.getCount()).isEqualTo(1);
    assertThat(duration.getCount()).isEqualTo(1);
    assertThat(duration.getSnapshot().size()).isEqualTo(1);
    assertThat(scheduledOnce.getCount()).isEqualTo(1);
    assertThat(scheduledRepetitively.getCount()).isZero();
    assertThat(scheduledOverrun.getCount()).isZero();
    assertThat(percentOfPeriod.getCount()).isZero();
}