@Test
public void testTraverse() throws Exception {

    TestUtil.withInMemoryRepo(session -> {
        TestUtil.installCndFromURL(session, getClass().getResource("/sling_nodetypes.cnd"));
        for (int i = 0; i < 5; i++) {
            JcrUtils.getOrCreateByPath("/test/node" + i, "nt:folder", session);
        }
        final ChecklistExporter exporter = new ChecklistExporter.Builder().build();
        List<ForcedRoot> roots = exporter.traverse(session,
                Arrays.asList("/test/node0", "/test/node2", "/test/node4", "/test/node6"));
        ForcedRoot root0 = roots.stream().filter(root -> "/test/node0".equals(root.getPath())).findFirst().orElse(null);
        assertNotNull("root0 should not be null", root0);
        assertEquals("root0 primaryType should be nt:folder", "nt:folder", root0.getPrimaryType());
        ForcedRoot root1 = roots.stream().filter(root -> "/test/node1".equals(root.getPath())).findFirst().orElse(null);
        assertNull("root1 should be null", root1);
        ForcedRoot root2 = roots.stream().filter(root -> "/test/node2".equals(root.getPath())).findFirst().orElse(null);
        assertNotNull("root2 should not be null", root2);
        assertEquals("root2 primaryType should be nt:folder", "nt:folder", root2.getPrimaryType());
        ForcedRoot root6 = roots.stream().filter(root -> "/test/node6".equals(root.getPath())).findFirst().orElse(null);
        assertNull("root6 should be null", root6);
    });
}