Najlepszy sposób na sprawdzenie, czy element nie jest obecny przy użyciu Selenium WebDriver z java

Próbuję kodu poniżej, ale wydaje się, że nie działa ... Czy ktoś może mi pokazać najlepszy sposób, aby to zrobić?

public void verifyThatCommentDeleted(final String text) throws Exception {
    new WebDriverWait(driver, 5).until(new ExpectedCondition<Boolean>() {
            @Override
            public Boolean apply(WebDriver input) {
                try {
                    input.findElement(By.xpath(String.format(
                            Locators.CHECK_TEXT_IN_FIRST_STATUS_BOX, text)));
                    return false;
                } catch (NoSuchElementException e) {
                    return true;
                }
            }
        });
    }

questionAnswers(7)

yourAnswerToTheQuestion