NodeState root = mock(NodeState.class);
when(root.getNames(any(String.class))).thenReturn(Collections.<String>emptySet());
SelectorImpl selector = new SelectorImpl(root, "a");
SolrServer solrServer = mock(SolrServer.class);
OakSolrConfiguration configuration = new DefaultSolrConfiguration();
SolrQueryIndex solrQueryIndex = new SolrQueryIndex("solr", solrServer, configuration);
FilterImpl filter = new FilterImpl(selector, "select * from [nt:base] as a where isdescendantnode(a, '/test')", new QueryEngineSettings());
filter.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
double cost = solrQueryIndex.getCost(filter, root);