title: wait until element not found or hidden
body: <p>I want to wait my thread until the element is not present or hidden. Trying code like this</p>
  
  <pre><code>new WebDriverWait(driver, TIME_OUT_SECS).until(new ExpectedCondition&lt;WebElement&gt;() {
                  @Override
                  public Boolean apply(WebDriver d) {
                      return !d.findElement(by).isDisplayed();
                  }
              });
  </code></pre>
  
  <p>but getting error</p>
  
  <pre><code>attempting to use incompatible return type
  </code></pre>