@Test
public void testGetInitStages() throws Exception {

    List<Checklist> checklists = this.constructIndivChecklists();
    ChecklistPlanner planner = new ChecklistPlanner(ALL_CKL_IDS);
    planner.provideChecklists(checklists);
    List<InitStage> initStages = planner.getInitStages();
    assertEquals("init stages count should be ", 4, initStages.size());
    new OakMachine.Builder().withInitStages(initStages).build().initAndInspect(session -> {
        assertTrue("/ChecklistPlannerTest/alpha node should exist",
                session.nodeExists("/ChecklistPlannerTest/alpha"));
        assertTrue("/ChecklistPlannerTest/bravo-1 node should exist",
                session.nodeExists("/ChecklistPlannerTest/bravo-1"));
        assertTrue("/ChecklistPlannerTest/bravo-2 node should exist",
                session.nodeExists("/ChecklistPlannerTest/bravo-2"));
        assertTrue("/ChecklistPlannerTest/charlie node should exist",
                session.nodeExists("/ChecklistPlannerTest/charlie"));
    });
    ChecklistPlanner selectivePlanner = new ChecklistPlanner(Collections.singletonList(CKL_NAME_BRAVO_2));
    selectivePlanner.provideChecklists(checklists);
    List<InitStage> selectiveStages = selectivePlanner.getInitStages();
    assertEquals("selective init stages count should be ", 1, selectiveStages.size());
    new OakMachine.Builder().withInitStages(selectiveStages).build().initAndInspect(session -> {
        assertFalse("/ChecklistPlannerTest/alpha node should not exist",
                session.nodeExists("/ChecklistPlannerTest/alpha"));
        assertFalse("/ChecklistPlannerTest/bravo-1 node should not exist",
                session.nodeExists("/ChecklistPlannerTest/bravo-1"));
        assertTrue("/ChecklistPlannerTest/bravo-2 node should exist",
                session.nodeExists("/ChecklistPlannerTest/bravo-2"));
        assertFalse("/ChecklistPlannerTest/charlie node should not exist",
                session.nodeExists("/ChecklistPlannerTest/charlie"));
    });
}