public static <T> List<T> getChildrenOfType(final @NotNull DomElement parent, final Class<T> type) {
    final List<T> result = new SmartList<>();
    parent.acceptChildren(new DomElementVisitor() {
      @Override
      public void visitDomElement(DomElement element) {
        if (type.isInstance(element)) {
          result.add(type.cast(element));
        }
      }
    });
    return result;
  }
public static <T> List<T> getChildrenOfType(final @NotNull DomElement parent, final Class<T> type)