private static Function<EventRequest, CompletableFuture<Void>> getEventRequestEnabler(boolean sync) {
    if (sync) {
      return r -> {
        r.enable();
        return CompletableFuture.completedFuture(null);
      };
    }
    else {
      return request -> DebuggerUtilsAsync.setEnabled(request, true);
    }
  }
private static Function<EventRequest, CompletableFuture<Void>> getEventRequestEnabler(boolean sync)