### Question:
HasTextMatcher extends TypeSafeMatcher<WebDriver> { @Factory public static Matcher<WebDriver> textOnCurrentPageContains(String text) { return textOnCurrentPage(CoreMatchers.containsString(text)); } protected  HasTextMatcher(Matcher<String> matcher); @Override void describeTo(Description description); @Factory static Matcher<WebDriver> textOnCurrentPageContains(String text); @Factory static Matcher<WebDriver> textOnCurrentPage(Matcher<String> text);  }### Answer:
@Test public void worksPositive() { WebDriver driver = mock(WebDriver.class); when(driver.getPageSource()).thenReturn(HTML_BODY); assertThat("Text should be found", driver, textOnCurrentPageContains(TEXT_PART)); }
@Test public void worksNegative() { final WebDriver driver = mock(WebDriver.class); when(driver.getPageSource()).thenReturn(ANOTHER_HTML_BODY); assertThat("Should not found text", driver, not(textOnCurrentPageContains(TEXT_PART))); }