@Test
public void clickWithRetriesFailure() throws Exception {

    when(browser.clickOn(any())).thenThrow(Exception.class).thenThrow(IOException.class).thenThrow(NoSuchElementException.class);
    try {
        Operations.doWithRetries(() -> browser.clickOn(div), 3, 10);
    } catch ( NoSuchElementException e) {
        verify(browser, times(3)).clickOn(div);
        return;
    }
    fail("expected to throw NoSuchElementException");
}