code: public static ExpectedCondition<Boolean> not(final ExpectedCondition<?> condition) {
      return new ExpectedCondition<Boolean>() {
        @Override
        public Boolean apply(WebDriver driver) {
          Object result = condition.apply(driver);
          return result == null || result.equals(Boolean.FALSE);
        }
  
        @Override
        public String toString() {
          return "condition to not be valid: " + condition;
        }
      };
    }
docs: An expectation with the logical opposite condition of the given condition.
  
  Note that if the Condition you are inverting throws an exception that is caught by the Ignored
  Exceptions, the inversion will not take place and lead to confusing results.
  
  @param condition ExpectedCondition to be inverted
  @return true once the condition is satisfied