@Test
public void testBuildWithJcrCustomizer() throws Exception {

    final File testPackage = TestPackageUtil.prepareTestPackage("tmp_foo_bar.zip");
    final CompletableFuture<String> latch = new CompletableFuture<>();
    builder().withPreInstallUrl(testPackage.toURI().toURL()).withJcrCustomizer(jcr -> {
        jcr.with((before, after, info) -> {
            if (!latch.isDone() && after.hasChildNode("tmp")) {
                final NodeState tmp = after.getChildNode("tmp");
                if (tmp.hasChildNode("foo")) {
                    final NodeState foo = tmp.getChildNode("foo");
                    if (foo.hasChildNode("bar")) {
                        final NodeState bar = tmp.getChildNode("foo");
                        latch.complete("/tmp/foo/bar");
                    }
                }
            }
            return after;
        });
    }).build().initAndInspect(session -> {
        assertTrue("path should exist", session.nodeExists("/tmp/foo/bar"));
    });
    assertEquals("latch should have path", "/tmp/foo/bar", latch.getNow(""));
}