### Question:
GeoWaveQueryInfoVisitor extends BaseVisitor { public GeoWaveQueryInfo parseGeoWaveQueryInfo(JexlNode script) { GeoWaveQueryInfo queryInfo = new GeoWaveQueryInfo(); script.childrenAccept(this, queryInfo); return queryInfo; } GeoWaveQueryInfoVisitor(Collection<String> geoFields); GeoWaveQueryInfo parseGeoWaveQueryInfo(JexlNode script); @Override Object visit(ASTEQNode node, Object data); @Override Object visit(ASTLENode node, Object data); @Override Object visit(ASTGENode node, Object data); @Override Object visit(ASTLTNode node, Object data); @Override Object visit(ASTGTNode node, Object data);  }### Answer:
@Test public void testGeoField() throws Exception { ASTJexlScript queryTree = JexlASTHelper.parseJexlQuery(COMBINED_FIELDS_QUERY); GeoWaveQueryInfo queryInfo = new GeoWaveQueryInfoVisitor(Arrays.asList("GEO_FIELD")).parseGeoWaveQueryInfo(queryTree); assertEquals(2, queryInfo.getMinTier()); assertEquals(2, queryInfo.getMaxTier()); }
@Test public void testGeomField() throws Exception { ASTJexlScript queryTree = JexlASTHelper.parseJexlQuery(COMBINED_FIELDS_QUERY); GeoWaveQueryInfo queryInfo = new GeoWaveQueryInfoVisitor(Arrays.asList("GEOM_FIELD")).parseGeoWaveQueryInfo(queryTree); assertEquals(5, queryInfo.getMinTier()); assertEquals(5, queryInfo.getMaxTier()); }
@Test public void testPointField() throws Exception { ASTJexlScript queryTree = JexlASTHelper.parseJexlQuery(COMBINED_FIELDS_QUERY); GeoWaveQueryInfo queryInfo = new GeoWaveQueryInfoVisitor(Arrays.asList("POINT_FIELD")).parseGeoWaveQueryInfo(queryTree); assertEquals(31, queryInfo.getMinTier()); assertEquals(31, queryInfo.getMaxTier()); }
@Test(expected = NumberFormatException.class) public void testOtherField() throws Exception { ASTJexlScript queryTree = JexlASTHelper.parseJexlQuery(COMBINED_FIELDS_QUERY); new GeoWaveQueryInfoVisitor(Arrays.asList("NAME")).parseGeoWaveQueryInfo(queryTree); }
@Test public void testCombinedFields() throws Exception { ASTJexlScript queryTree = JexlASTHelper.parseJexlQuery(COMBINED_FIELDS_QUERY); GeoWaveQueryInfo queryInfo = new GeoWaveQueryInfoVisitor(Arrays.asList("GEO_FIELD", "GEOM_FIELD", "POINT_FIELD")).parseGeoWaveQueryInfo(queryTree); assertEquals(2, queryInfo.getMinTier()); assertEquals(31, queryInfo.getMaxTier()); }