@Test
public void hasElementNTimesSuccess() {

    when(browser.findPageWithNumberOfOccurrences(eq(div), eq(2), eq(exactly))).thenReturn(mock(WebElement.class));
    assertThat(browser, CustomMatchers.hasElements(div).present(2).times());
}