code: public void matches(int expectedMatches, double seconds) {
          double end = System.currentTimeMillis() + (seconds * 1000);
          try {
              if (expectedMatches > 0) {
                  elementPresent(seconds);
              }
              while (element.get().matchCount() != expectedMatches && System.currentTimeMillis() < end) ;
              double timeTook = Math.min((seconds * 1000) - (end - System.currentTimeMillis()), seconds * 1000) / 1000;
              checkMatches(expectedMatches, seconds, timeTook);
          } catch (TimeoutException e) {
              checkMatches(expectedMatches, seconds, seconds);
          }
      }
docs: Waits for the element has a the expected number of matches on the page, e.g.
  how many elements match the locator and target provided.
  The provided wait time will be used and if the element doesn't
  have the desired match count at that time, it will fail, and log
  the issue with a screenshot for traceability and added debugging support.
  
  @param expectedMatches - the expected number of elements matching the locator
  @param seconds         - how many seconds to wait for