@Test
public void testConcurrency2() throws Exception
{

    CuratorOp op1 = client.transactionOp().create().forPath("/test");
    CuratorOp op2 = client.transactionOp().create().forPath("/test/bar", "first".getBytes());
    Migration migration = () -> Arrays.asList(op1, op2);
    MigrationSet migrationSet = MigrationSet.build("1", Collections.singletonList(migration));
    CountDownLatch latch = new CountDownLatch(1);
    filterLatch.set(latch);
    CompletionStage<Void> first = manager.migrate(migrationSet);
    Assert.assertTrue(timing.awaitLatch(filterIsSetLatch));
    CompletionStage<Void> second = manager.migrate(migrationSet);
    try
    {
        second.toCompletableFuture().get(timing.forSleepingABit().milliseconds(), TimeUnit.MILLISECONDS);
        Assert.fail("Should throw");
    }
    catch ( Throwable e )
    {
        Assert.assertTrue(Throwables.getRootCause(e) instanceof TimeoutException, "Should throw TimeoutException, was: " + Throwables.getStackTraceAsString(Throwables.getRootCause(e)));
    }
    latch.countDown();
    complete(first);
    Assert.assertEquals(client.unwrap().getData().forPath("/test/bar"), "first".getBytes());
    complete(second);
    Assert.assertEquals(manager.debugCount.get(), 1);
}