### Question:
RqlParser { public static Term parse(String paramName, String paramValue) { String termStr; if (Utils.empty(paramValue) && paramName.contains("(")) { termStr = paramName; } else { if (Utils.empty(paramValue)) paramValue = "true"; termStr = "eq(" + paramName + "," + paramValue + ")"; } Term term = RqlParser.parse(termStr); return term; } private  RqlParser(); static Term parse(String paramName, String paramValue); static Term parse(String clause);  }### Answer:
@Test public void test1() throws Exception { List<List> tests = new ArrayList<>(); add(tests, "eq(column,String)", "column=String"); add(tests, "eq(column,string)", "column= string"); add(tests, "eq(column,string)", "column= string "); add(tests, "eq(column,'string')", "column='string'"); add(tests, "eq(\"column\",string)", "\"column\"=string"); add(tests, "eq('column','str ing')", "'column'='str ing'"); add(tests, "eq(column,'str\"ing')", "column='str\"ing'"); add(tests, "eq(column,\"column\")", "column=\"column\""); add(tests, "eq(column with spaces,string with spaces)", "eq(column with spaces, string with spaces)"); add(tests, "eq(a'bc)", "eq(a'bc)"); add(tests, "func(a,b)", "a=func=b"); add(tests, "func(a,b)", "func(a , b )"); add(tests, "eq(column,test')", "column=test\\\'"); add(tests, "eq(column,test\")", "column=test\\\""); add(tests, "eq(column,Barb 1\\2 Pnt W 6 Tort)", "eq(column,Barb 1\\\\2 Pnt W 6 Tort)"); for (int i = tests.size() - 1; i >= 0; i--) { List test = tests.get(i); String reference = test.get(0).toString(); for (int j = 1; j < test.size(); j++) { Object query = test.get(j).toString(); if (query instanceof String) query = RqlParser.parse(query.toString()).toString(); else query = query.toString(); if (!Utils.testCompare(reference, (String) query)) throw new Exception("Test case: " + (i + 1) + "[" + j + "] failed. src = " + reference + " - term = " + query); } } System.out.println("PASSED"); }
@Test public void test2() throws Exception { Term t = RqlParser.parse("w(name,'BANANA KG (RESEAU')"); assertEquals("BANANA KG (RESEAU", t.getTerm(1).getToken()); t = RqlParser.parse("w(name,'BANANA KG (RESEAU)')"); assertEquals("BANANA KG (RESEAU)", t.getTerm(1).getToken()); }