NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
NodeDefinitionTemplate childDefn = ntMgr.createNodeDefinitionTemplate();
childDefn.setSameNameSiblings(false);
childDefn.setRequiredPrimaryTypeNames(new String[] {"nt:unstructured"});
childDefn.setDefaultPrimaryTypeName("nt:unstructured");
NodeTypeTemplate nodeType = ntMgr.createNodeTypeTemplate();
nodeType.setName("noSnsChildren");
nodeType.getNodeDefinitionTemplates().add(childDefn);
NodeType newNodeType = ntMgr.registerNodeType(nodeType, false);
assertThat(newNodeType, is(notNullValue()));