code: public static boolean isElementPresent(String locator) {
          logger.entering(locator);
          boolean flag = false;
          try {
              flag = HtmlElementUtils.locateElement(locator) != null;
          } catch (NoSuchElementException e) { // NOSONAR
          }
          logger.exiting(flag);
          return flag;
      }
docs: Checks if the provided element is present on the page based on the locator provided
  
  @param locator
  String that represents the means to locate this element (could be id/name/xpath/css locator).
  @return boolean indicating if the element was found.