Apache Commons Lang StringUtils Slower
<blockquote>
  <p>Background</p>
</blockquote>

<p>Trying a simple experiment to find out if tradition <code>if</code> statement to check null is faster than Apache Commons Lang StringUtils <code>isEmpty</code>/<code>isBlank</code>.  </p>

<p>To run this test, I am using <code>Java 8u102</code>, Apache Commons Lang version <code>3.4</code> and running on Windows 10 64-bit.</p>

<blockquote>
  <p>The Test Code</p>
</blockquote>

<p>Below are the test codes using standard main class:</p>

<pre><code>        System.out.println("Testing of StringUtils.isNotNull vs native java method");
        System.out.println("======================================================");
        System.out.println("Testing conventional method...");
        final List&lt;String&gt; array = new ArrayList&lt;String&gt;();
        array.add("1");
        array.add(null);
        array.add("3");
        array.add(null);
        array.add("5");
        long start = System.currentTimeMillis();
        for (String s : array) {
            System.out.println(s == null ? "yes" : "no");
        }
        System.out.println(System.currentTimeMillis() - start);
        System.out.println("Testing StringUtils method...");
        start = System.currentTimeMillis();
        for (String s : array) {
            System.out.println(StringUtils.isBlank(s) ? "yes" : "no");
        }
        System.out.println(System.currentTimeMillis() - start);
</code></pre>

<blockquote>
  <p>The Result</p>
</blockquote>

<pre><code>Testing of StringUtils.isNotNull vs native java method
======================================================
Testing conventional method...
no
yes
no
yes
no
0
Testing StringUtils method...
no
yes
no
yes
no
6
</code></pre>

<p>To my very surprised that native method is way faster than Apache Commons Lang library.</p>

<blockquote>
  <p>The Question</p>
</blockquote>

<p>Can anyone pointed out if my result is conclusive? Is there any chances that my test is wrong therefore such result? Thanks. </p>