assertEquals(expected.toString(), task.processTemplate(template).toString());
PrecomputeTask.QueryAndIndexes qai = task.processTemplate(template); System.out.println("generate: " + qai.getQuery()); assertEquals(expected.toString(), qai.toString()); ObjectStore os = ObjectStoreFactory.getObjectStore("os.unittest"); System.out.println("generate: " + qai.getQuery());  task.precompute(os, qai.getQuery(), qai.getIndexes());
    public void testPrecomputeTemplate() throws Exception {        PrecomputeTask task = new PrecomputeTask();        Map templates = task.getPrecomputeTemplateQueries();        TemplateQuery template = (TemplateQuery) templates.get("employeesOverACertainAgeFromDepartmentA");        System.out.println(MainHelper.makeQuery(template.getQuery(), new HashMap(), new HashMap()));        Query q = new Query();        q.setDistinct(true);        ConstraintSet cs = new ConstraintSet(ConstraintOp.AND);        QueryClass qcEmp = new QueryClass(Employee.class);        QueryField qfAge = new QueryField(qcEmp, "age");        q.addFrom(qcEmp);        QueryClass qcDept = new QueryClass(Department.class);        q.addFrom(qcDept);        QueryObjectReference deptRef = new QueryObjectReference(qcEmp, "department");        ContainsConstraint cc = new ContainsConstraint(deptRef, ConstraintOp.CONTAINS, qcDept);        cs.addConstraint(cc);        QueryField qfName = new QueryField(qcDept, "name");        SimpleConstraint sc = new SimpleConstraint(qfName, ConstraintOp.EQUALS, new QueryValue("DepartmentA"));        cs.addConstraint(sc);        q.addToSelect(qcEmp);        q.addToSelect(qfAge);        q.setConstraint(cs);        PrecomputeTask.QueryAndIndexes expected = task.new QueryAndIndexes();        expected.setQuery(q);        expected.addIndex(qfAge);        assertEquals(expected.toString(), task.processTemplate(template).toString());    }