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