void doWhenExecuted(final @NotNull Runnable runnable) {
    Runnable toRun;
    synchronized (this) {
      if (isExecuted()) {
        if (myRunnables == null) {
          toRun = runnable;
        }
        else {
          CompositeRunnable composite = new CompositeRunnable(myRunnables);
          composite.add(runnable);
          toRun = composite;
          myRunnables = null;
        }
      }
      else {
        if (myRunnables == null) {
          myRunnables = new SmartList<>();
        }

        myRunnables.add(runnable);
        return;
      }
    }

    toRun.run();
  }
void doWhenExecuted(final @NotNull Runnable runnable)