code: public <T> ExpectedCondition<T> getConditionIgnoringStaleElement(final ExpectedCondition<T> condition) {
          return d -> {
              try {
                  return condition.apply(webDriver);
              } catch (WebDriverException e) {
                  if (isStaleElementException(e)) {
                      return null;
                  } else {
                      throw e;
                  }
              }
          };
      }
docs: Wraps the supplied condition so that StaleElementReferenceExceptions (and the Safari equivalent)
  are to thrown by waitUntil(), but just mean: try again.
  @param condition condition to wrap.
  @param <T> retrun type of condition
  @return wrapped condition.