private static void switchToSuspendAll(@NotNull SuspendContextImpl suspendContext,
                                         @NotNull Function<@NotNull SuspendContextImpl, Boolean> performOnSuspendAll) {
    DebugProcessImpl process = suspendContext.getDebugProcess();
    SuspendManager suspendManager = process.getSuspendManager();
    SuspendContextImpl newSuspendContext = suspendManager.pushSuspendContext(EventRequest.SUSPEND_ALL, 1);
    // It is an optimization to reduce the synchronous packets number
    newSuspendContext.setEventSet(suspendContext.getEventSet());
    //noinspection DataFlowIssue
    newSuspendContext.setThread(suspendContext.getEventThread().getThreadReference());
    if (processSuspendAll(newSuspendContext, suspendContext, performOnSuspendAll)) {
      process.getManagerThread().schedule(new SuspendContextCommandImpl(newSuspendContext) {
        @Override
        public void contextAction(@NotNull SuspendContextImpl suspendContext) {
          //noinspection DataFlowIssue
          DebugProcessEvents.preloadEventInfo(suspendContext.getEventThread().getThreadReference(), null);
          // Note, pause listener in the DebugProcessImpl will resume suspended evaluations
          suspendManager.voteSuspend(newSuspendContext);
        }
      });
    }
    else {
      suspendManager.resume(newSuspendContext);
    }
  }
private static void switchToSuspendAll(@NotNull SuspendContextImpl suspendContext,
                                         @NotNull Function<@NotNull SuspendContextImpl, Boolean> performOnSuspendAll)