CompletableFuture<Integer> (ThreadReference thread) { if (thread instanceof ThreadReferenceImpl && isAsyncEnabled()) { return reschedule(((ThreadReferenceImpl)thread).frameCountAsync()); } return toCompletableFuture(() -> thread.frameCount()); }