private static FilterImpl createFilter(NodeState root, String nodeTypeName) {
NodeState system = root.getChildNode(JCR_SYSTEM);
NodeState types = system.getChildNode(JCR_NODE_TYPES);
NodeState type = types.getChildNode(nodeTypeName);
SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]", new QueryEngineSettings());
}