@Test
public void should_loop_commands_until_false_is_returned() {

    AtomicInteger i = new AtomicInteger(5);
    //when
    TransportExecutors.loop(Runnable::run, () -> i.decrementAndGet() > 0);
    //then
    assertEquals(0, i.get());
}