@Test
public void testRefreshThrows() throws RepositoryException {

    Session session = mock(Session.class);
    CompletableFuture<String> latch = new CompletableFuture<>();
    doAnswer(invoked -> latch.complete("refreshed")).when(session).refresh(anyBoolean());
    JcrSessionFacade facade = new JcrSessionFacade(session, true);
    facade.refresh(true);
    assertEquals("latch value should be", "refreshed", latch.getNow(""));
}