title: Parse String statement into a boolean expression
body: <p>I have a string statement <code>String s = sb.contains(&quot;is&quot;);</code></p>
  <p>I want to use this in an <code>if</code> condition like</p>
  <pre><code>if (s) {
    //do something
  }
  </code></pre>
  <p>How can I achieve this functionality?</p>
  <p>Edit: Basically I get a boolean logic along with strings as an input. Ex: &quot;Stack &amp; over &amp; (is | flow)&quot;. I have an array of sentences and I have to pick every sentence that follows this logic. I thought I would construct a string like &quot;sb.contains(stack) &amp;&amp; sb.contains(over) &amp;&amp; (sb.contains(is) || sb.contains(flow))&quot; and I thought I would run this boolean logic over all the sentences. Is there any other way of doing this?</p>