* @return
*/
public GraphExecutableQuery getQuery(IndexableGraph database, SortingExpression sortingExpression) {
// At the end of the visit, there should be only one item in stack : the root one
if(tests.size()!=1) {
throw new InvalidTestStructureException(tests);
}
return new OptimizedGraphExecutableQuery(service, tests.peek(), sortingExpression);
// return new BasicGraphExecutableQuery(service, tests.peek(), sortingExpression);
}