@Test
public void hasElementNTimesOrLessSuccess() {

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