### Question:
ExpressionBuilder { public boolean buildExpression(String query, int clnId) { Parser p = new Parser(this, clnId); if (p.parse(query)) { return expressions.size() > 0; } return false; }  int addExpression(Expression exp); int addExpression(int clnId, Comparison compType, PathBuilder path, String param); Expression getExpression(int exIdx); List<Expression> getExpressions(); int getCollectionId(); Expression getRoot(); @Override String toString(); boolean buildExpression(String query, int clnId);  }### Answer:
@Test public void testParseQuery() { String query = "/inventory/product-id = $pids"; ExpressionBuilder eb = new ExpressionBuilder(); assertTrue(eb.buildExpression(query, 1)); System.out.println(eb); }
@Test public void testParseQuery1() { String query = "(/inventory/product-id = $pids) AND ((/inventory/virtual-stores/status = 'active') AND ((/inventory/virtual-stores/region-id = rid) OR (rid = null)))"; ExpressionBuilder eb = new ExpressionBuilder(); assertTrue(eb.buildExpression(query, 1)); System.out.println(eb); }
@Test public void testParseQuery2() { String query = "((/inventory/virtual-stores/status = 'active') AND ((/inventory/virtual-stores/region-id = rid) OR (rid = null))) AND (/inventory/product-id = $pids)"; ExpressionBuilder eb = new ExpressionBuilder(); assertTrue(eb.buildExpression(query, 1)); System.out.println(eb); }
@Test public void testParseQuery3() { String query = "(((/inventory/virtual-stores/region-id = rid) OR (rid = null)) AND (/inventory/virtual-stores/status = 'active')) AND (/inventory/product-id = $pids)"; ExpressionBuilder eb = new ExpressionBuilder(); assertTrue(eb.buildExpression(query, 1)); System.out.println(eb); }