private CompletableFuture<Void> enableRequest(EventRequest request, Function<EventRequest, CompletableFuture<Void>> enabler) {
    DebuggerManagerThreadImpl.assertIsManagerThread();
    LOG.assertTrue(findRequestor(request) != null);
    try {
      final ThreadReference filterThread = myFilterThread == null ? null : myFilterThread.getRealThread();
      if (filterThread != null && DebuggerSession.filterBreakpointsDuringSteppingUsingDebuggerEngine()) {
        if (request instanceof BreakpointRequest) {
          ((BreakpointRequest)request).addThreadFilter(filterThread);
        }
        else if (request instanceof MethodEntryRequest) {
          ((MethodEntryRequest)request).addThreadFilter(filterThread);
        }
        else if (request instanceof MethodExitRequest) {
          ((MethodExitRequest)request).addThreadFilter(filterThread);
        }
      }
      return enabler.apply(request);
    }
    catch (InternalException e) {
      switch (e.errorCode()) {
        case JvmtiError.DUPLICATE -> LOG.info(e);
        case JvmtiError.NOT_FOUND -> {
          //event request not found
          //there could be no requests after hotswap
        }

        default -> LOG.error(e);
      }
    }
    return CompletableFuture.completedFuture(null);
  }
private CompletableFuture<Void> enableRequest(EventRequest request, Function<EventRequest, CompletableFuture<Void>> enabler)