code: public static ExpectedCondition<List<WebElement>> presenceOfAllElementsLocatedBy(
      final By locator) {
      return new ExpectedCondition<List<WebElement>>() {
        @Override
        public List<WebElement> apply(WebDriver driver) {
          List<WebElement> elements = driver.findElements(locator);
          return elements.size() > 0 ? elements : null;
        }
  
        @Override
        public String toString() {
          return "presence of any elements located by " + locator;
        }
      };
    }
docs: An expectation for checking that there is at least one element present on a web page.
  
  @param locator used to find the element
  @return the list of WebElements once they are located