### Question:
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource.contains(string) : containsIgnoreCase(pageSource, string); if (mustExist != outcome) { if (mustExist) { throw new ValidationException("Could not find string '" + string + "' (case-sensitive=" + caseSensitive + ")"); } throw new ValidationException("String '" + string + "' must not occur"); } } CheckHtml4String(final String string);  CheckHtml4String(final String string, final boolean caseSensitive);  CheckHtml4String(final String string, final boolean caseSensitive, final boolean mustExist); @Override void execute();  }### Answer:
@Test public void stringMustExistCaseSensitively() { CheckHtml4String checkHtml4String = new CheckHtml4String("Case-Sensitive"); checkHtml4String.setWebDriver(webDriver); checkHtml4String.execute(); }
@Test public void stringMustExistNotCaseSensitively() { CheckHtml4String checkHtml4String = new CheckHtml4String("case-sensitive", false); checkHtml4String.setWebDriver(webDriver); checkHtml4String.execute(); }
@Test public void stringMustNotExistCaseSensitively() { CheckHtml4String checkHtml4String = new CheckHtml4String("foo", true, false); checkHtml4String.setWebDriver(webDriver); checkHtml4String.execute(); }
@Test public void stringMustNotExistNotCaseSensitively() { CheckHtml4String checkHtml4String = new CheckHtml4String("foo", false, false); checkHtml4String.setWebDriver(webDriver); checkHtml4String.execute(); }