### Question:
SahiScript { String findCondition(String s) { char c = ' '; boolean escaped = false; boolean doubleQuoted = false; boolean quoted = false; int len = s.length(); int bracket = 0; int i = 0; i = s.indexOf("_condition"); i = s.indexOf("(", i) + 1; if (i == 0) { return null; } int start = i; int end = -1; for (; i < len; i++) { c = s.charAt(i); if (c == '\\') { escaped = !escaped; } if (!escaped && !(Character.isJavaIdentifierPart(c) || c == '.')) { if (c == '"') { if (!(escaped || quoted)) { doubleQuoted = !doubleQuoted; } } else if (c == '\'') { if (!(escaped || doubleQuoted)) { quoted = !quoted; } } else if (!escaped && !quoted && !doubleQuoted) { if (c == '(') { bracket++; } else if (c == ')') { bracket--; if (bracket < 0) { end = i; break; } } } } if (c != '\\') { escaped = false; } } if (end == -1) { return null; } return s.substring(start, end); } SahiScript(String filePath, ArrayList<String> parents, String scriptName); String jsString(); String modifiedScript(); String getDebugInfo(int lineNumber); String getLineDebugInfo(int lineNumber); static boolean lineStartsWithActionKeyword(String line); static String modifySingleLine(String line); static String modifyFunctionNames(String unmodified); static String stripSahiFromFunctionNames(String unmodified); static ArrayList<String> getActionKeyWords(); static ArrayList<String> getKeyWords(); String modifyCondition(String s, int lineNumber); String getScriptName(); String getOriginal(); String getOriginalInHTML(); String getFilePath(); String getBrowserJS(); void addIncludeInfo(SahiScript included); String getBrowserJSWithLineNumbers();  }### Answer:
@Test public void testFindCondition() { assertEquals("'' == _textbox(\"t1\").value", testScript.findCondition("_condition('' == _textbox(\"t1\").value)")); assertEquals("'$x' == _textbox(\"t1\").value", testScript.findCondition("_condition('$x' == _textbox(\"t1\").value)")); }