@Test
public void testReadNodeTypes() {

    List<URL> cnds = Stream.of("a", "b", "c", "d", "e", "f")
            .map(letter -> new File(baseDir, letter + ".cnd"))
            .map(compose1(File::toURI, uncheck1(URI::toURL)))
            .collect(Collectors.toList());
    final List<Result<NodeTypeSet>> sets = JsonCnd.readNodeTypes(getMapping(), cnds);
    assertEquals("sets should have n sets", cnds.size(), sets.size());
    assertTrue("all are successful", sets.stream().allMatch(Result::isSuccess));
    assertTrue("all are successful", sets.stream()
            .map(result -> result
                    .map(compose1(NodeTypeSet::getNodeTypes, Map::size))
                    .getOrDefault(0))
            .allMatch(size -> size == 2));
    List<URL> cndsWithError = Stream.of("a", "b", "c", "error", "d", "e", "f")
            .map(letter -> new File(baseDir, letter + ".cnd"))
            .map(compose1(File::toURI, uncheck1(URI::toURL)))
            .collect(Collectors.toList());
    final List<Result<NodeTypeSet>> setsWithError = JsonCnd.readNodeTypes(getMapping(), cndsWithError);
    assertEquals("setsWithError should have n sets", cndsWithError.size(), setsWithError.size());
    assertFalse("not all are successful", setsWithError.stream().allMatch(Result::isSuccess));
    assertEquals("setsWithError should have n successful sets", cndsWithError.size() - 1,
            setsWithError.stream().filter(Result::isSuccess).count());
}