private static boolean processSuspendAll(@NotNull SuspendContextImpl suspendContext,
                                           @NotNull SuspendContextImpl originalContext,
                                           @NotNull Function<@NotNull SuspendContextImpl, Boolean> performOnSuspendAll) {
    // Need to 'replace' the myThreadSuspendContext (single-thread suspend context passed filtering) with this one.
    suspendContext.resetThread(Objects.requireNonNull(originalContext.getEventThread()));

    // Note, myThreadSuspendContext is resuming without SuspendManager#voteSuspend.
    // Look at the end of DebugProcessEvents#processLocatableEvent for more details.
    suspendContext.getDebugProcess().getSuspendManager().voteResume(originalContext);

    suspendContext.mySuspendAllSwitchedContext = true;
    DebugProcessImpl process = suspendContext.getDebugProcess();
    for (Runnable listener : process.mySuspendAllListeners) {
      listener.run();
    }
    process.mySuspendAllListeners.clear();
    process.myPreparingToSuspendAll = false;

    return performOnSuspendAll.apply(suspendContext);
  }
private static boolean processSuspendAll(@NotNull SuspendContextImpl suspendContext,
                                           @NotNull SuspendContextImpl originalContext,
                                           @NotNull Function<@NotNull SuspendContextImpl, Boolean> performOnSuspendAll)