@Test
public void testAggregateNodeTypes() {

    final List<URL> cnds = Stream.of("a", "bb", "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>> setsWithError = JsonCnd.readNodeTypes(getMapping(), cnds);
    final NodeTypeSet aggregate = JsonCnd.aggregateNodeTypes(getMapping(), setsWithError.stream()
            .collect(Result.tryCollect(Collectors.toList()))
            .getOrDefault(Collections.emptyList()));
    final Name bPrimaryType = NameFactoryImpl.getInstance()
            .create("http://b.com/1.0", "primaryType");
    final Name bProperty = NameFactoryImpl.getInstance()
            .create("http://b.com/1.0", "property");
    assertTrue("expect b:primaryType",
            aggregate.getNodeTypes().containsKey(bPrimaryType));
    assertTrue("b:primaryType should define b:property",
            Stream.of(aggregate.getNodeTypes().get(bPrimaryType).getPropertyDefs())
                    .anyMatch(def -> bProperty.equals(def.getName())));
}