@Test
public void testLogoutThrows() {

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