@Test
public void testSetLimit() {

    Query delegate = mock(Query.class);
    QueryFacade<Query, Session> facade = getFacade(delegate);
    CompletableFuture<Long> latch = new CompletableFuture<>();
    doAnswer(invoked -> latch.complete(invoked.getArgument(0))).when(delegate).setLimit(anyLong());
    final long value = 42L;
    facade.setLimit(value);
    assertEquals("same value in latch", (Long) value, latch.getNow(0L));
}