@SuppressWarnings("SSBasedInspection")
  synchronized void disposeChildren(int delayMs) {
    if (delayMs <= 0) {
      for (MenuItem item : myItems) {
        item.dispose();
      }
    }
    else {
      // Schedule to dispose later.
      // NOTE: Can be invoked in any thread, not only EDT
      final ArrayList<MenuItem> copy = new ArrayList<>(myItems);
      SimpleTimer.getInstance().setUp(() -> {
        for (MenuItem item : copy) {
          item.dispose();
        }
      }, delayMs);
    }
    myItems.clear();
  }
@SuppressWarnings("SSBasedInspection")
  synchronized void disposeChildren(int delayMs)