@Test
public void hasNoElementFailed() {

    when(browser.find(any())).thenReturn(mock(WebElement.class));
    try {
        assertThat(browser, CustomMatchers.hasNoElement(div));
        fail("should fail");
    } catch (AssertionError e) {
        assertThat(e.getMessage(), is(equalTo("\nExpected: browser page does not contain div\n     but: div is present")));
    }
}