code: public int size() {
          int size = 0;
          try {
              if (getParent() != null) {
                  size = getParent().locateChildElements(getLocator()).size();
              } else {
                  size = HtmlElementUtils.locateElements(getLocator()).size();
              }
          } catch (NoSuchElementException e) { // NOSONAR
              // do nothing, let size be returned as 0
          }
  
          return size;
      }
docs: Returns the number of containers found on the page.
  
  @return the number of containers found on the page