title: Wrong values from string empty test (java x kotlin)
body: <p>I'm having a super weird behavior from a code that I was testing. The test I wrote was to see the behavior of the class if the Android returned an empty package name. After some debugging, I found this (consider that packageName is <strong>empty</strong>):</p>
  <pre><code> val resultFromKotlin = packageName.isNullOrEmpty()
   val resultFromJava = StringUtils.isEmpty(packageName)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/sPMpr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sPMpr.png" alt="Image from Andriod Studio debug" /></a></p>
  <p>Is this expected? Can someone tell what the deal with this?</p>
  <p>ps1.: In the picture above, Android Studio was complaining of <code>isNullOrEmpty</code> saying that could be simplified since <code>packageName</code> can't be null at that point.</p>
  <p>ps2.: For references:</p>
  <p>The <code>StringUtils</code> class is written in Java as follow:</p>
  <pre><code>public static boolean isEmpty(String str) {
      return str == null || TextUtils.isEmpty(str.trim());
  }
  </code></pre>
  <p>TextUtils is also from Java, but it's part of Android library:</p>
  <pre><code>public static boolean isEmpty(@Nullable CharSequence str) {
      return str == null || str.length() == 0;
  }
  </code></pre>
  <p>This is how kotlin implements it's extension method:</p>
  <pre><code>public inline fun CharSequence?.isNullOrEmpty(): Boolean {
      contract {
          returns(false) implies (this@isNullOrEmpty != null)
      }
  
      return this == null || this.length == 0
  }
  </code></pre>
  <p><strong>EDIT 08/11/2018</strong>:
  Just for clarification, my problem is the wrong value returned from Java, not searching for an equivalence in the test, also:
  <a href="https://i.stack.imgur.com/a9RNT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a9RNT.png" alt="enter image description here" /></a></p>