class ChecklistExporter {

    Optional<ForcedRoot> nodeToRoot(final Node node, final NamespaceMapping mapping) throws RepositoryException {
        if (Rules.lastMatch(pathScopes, node.getPath()).isExclude()) {
            return Optional.empty();
        }

        ForcedRoot forcedRoot = new ForcedRoot();
        forcedRoot.setPath(node.getPath());
        final String primaryType = node.getPrimaryNodeType().getName();
        if (Rules.lastMatch(nodeTypeFilters, QName.parseQName(mapping, QName.Type.NODETYPE, primaryType).toString()).isInclude()) {
            forcedRoot.setPrimaryType(primaryType);
        }
        final List<String> mixinTypes = Stream.of(node.getMixinNodeTypes())
                .map(compose1(NodeType::getName,
                        qName -> QName.parseQName(mapping, QName.Type.NODETYPE, qName).toString()))
                .filter(name -> Rules.lastMatch(nodeTypeFilters, name).isInclude())
                .collect(Collectors.toList());
        forcedRoot.setMixinTypes(mixinTypes);
        return Optional.of(forcedRoot);
    }

    private  ChecklistExporter(final List<Op> operations,
                              final List<String> exportTypeDefs,
                              final List<Rule> pathScopes,
                              final List<Rule> nodeTypeFilters,
                              final List<JcrNs> jcrNamespaces);

}