multiple boolean tests within one method : <p>I have a class with different boolean properties set and the method <code>test()</code> checks all these properties and returns a boolean value. </p>

<p><strong>Which is the fastest way?</strong></p>

<p><strong>version 1:</strong></p>

<pre><code>public boolean test(){
if(!test1) return false; 
if(!test2) return false; 
if(!test3) return false; 
if(!test4) return false; 
if(!test5) return false; 
if(!test6) return false; 
if(!test7) return false; 
return true;
}
</code></pre>

<p><strong>version 2:</strong></p>

<pre><code>public boolean test(){
    return test1 &amp;&amp; test2 &amp;&amp; test3 &amp;&amp; test4 &amp;&amp; test5 &amp;&amp; test6 &amp;&amp; test7;
}
</code></pre>

<p><strong>version 3:</strong></p>

<pre><code>public boolean test(){
        Predicate&lt;Boolean&gt; test1 = c -&gt; getTest1(); 
        Predicate&lt;Boolean&gt; test2 = c -&gt; getTest2(); 
        Predicate&lt;Boolean&gt; test3 = c -&gt; getTest3(); 
        Predicate&lt;Boolean&gt; test4 = c -&gt; getTest4(); 
        Predicate&lt;Boolean&gt; test5 = c -&gt; getTest5(); 
        Predicate&lt;Boolean&gt; test6 = c -&gt; getTest6(); 
        Predicate&lt;Boolean&gt; test7 = c -&gt; getTest7(); 
        return test1.and(test2).and(test3).and(test4).and(test5).and(test6).and(test7).test(true);
        }
</code></pre>

<p>I would prefer version 1, because it`s the cleanest way, however, which one is the fastest?</p>
