@Test
public void testWaitUntilTransportable() throws InterruptedException {

    final AtomicLong later = new AtomicLong(0);
    Thread thread = new Thread(new Runnable() {
        @Override
        public void run() {
            ((Buffer) store).waitUntilTransportable();
            later.set(Time.now());
        }
    });
    thread.start();
    long before = Time.now();
    while (!((Buffer) store).canTransport()) {
        before = Time.now();
        add(TestData.getString(), TestData.getTObject(),
                TestData.getLong());
    }
    thread.join(); // make sure thread finishes before comparing
    Assert.assertTrue(later.get() > before);
}