CompletableFuture<Void> (EventRequest request, boolean value) { EventRequestManager eventRequestManager = request.virtualMachine().eventRequestManager(); if (eventRequestManager instanceof EventRequestManagerImpl && isAsyncEnabled()) { return ((EventRequestManagerImpl)eventRequestManager).setEnabledAsync(request, value); } return toCompletableFuture(() -> request.setEnabled(value)); }