@Test
public void testFromJson() {

    final ForcedRoot.JsonKeys keys = ForcedRoot.keys();
    final String path = "/correct/path";
    final String primaryType = "primaryType";
    final List<String> mixinTypes = Collections.singletonList("mixinType");
    final ForcedRoot rootEmpty = ForcedRoot.fromJson(obj().get());
    assertNull("empty root has null path", rootEmpty.getPath());
    assertNull("empty root has null primaryType", rootEmpty.getPrimaryType());
    assertTrue("empty root has empty mixinTypes", rootEmpty.getMixinTypes().isEmpty());
    final ForcedRoot rootPath = ForcedRoot.fromJson(
            obj().key(keys.path(), path).get());
    assertEquals("path root has correct path", path, rootPath.getPath());
    final ForcedRoot rootPrimaryType = ForcedRoot.fromJson(
            obj().key(keys.primaryType(), primaryType).get());
    assertEquals("primaryType root has correct primaryType",
            primaryType, rootPrimaryType.getPrimaryType());
    final ForcedRoot rootMixinTypes = ForcedRoot.fromJson(
            obj().key(keys.mixinTypes(), mixinTypes).get());
    assertEquals("mixinTypes root has correct mixinTypes",
            mixinTypes, rootMixinTypes.getMixinTypes());
}