@Test
public void testFromJson() throws Exception {

    final File targetFile = new File(testOutDir, "testFromJson.json");
    if (targetFile.exists()) {
        targetFile.delete();
    }
    OakMachine.Builder emptyOak = TestUtil.fromPlan(obj().get());
    WebsterChecklistTarget target = WebsterChecklistTarget.fromJson(targetFile, obj().get());
    emptyOak.build().initAndInspect(target::perform);
    OakMachine.Builder twoRootsOak = TestUtil.fromPlan(obj()
            .key("forcedRoots", arr()
                    .val(new ForcedRoot().withPath("/foo1"))
                    .val(new ForcedRoot().withPath("/foo2"))
            )
            .get());
    WebsterChecklistTarget twoRootsTarget = WebsterChecklistTarget.fromJson(targetFile, obj()
            .key("selectors", arr()
                    .val(key("type", "path").key("args", arr("/foo1", "/foo2")))
            )
            .get());
    twoRootsOak.build().initAndInspect(twoRootsTarget::perform);
    assertJsonFile(targetFile, json -> {
        final Checklist checklist = Checklist.fromJson("testFromJson", null, json);
        assertEquals("expect 2 roots", 2, checklist.getForcedRoots().size());
    });
}