title: Java Generics: incompatible type required String; found: java.lang.String
body: <p>I'm getting this compiler error in netbeans:</p>
  
  <p>incompatible types
    required: String
    found:    java.lang.String</p>
  
  <p>I'm kind of lost as why this happens? </p>
  
  <p>Code:</p>
  
  <pre><code>private class StringIterator&lt;String&gt; implements Iterator&lt;String&gt; {
  
      private Iterator&lt;Entry&lt;K, byte[]&gt;&gt; i = internalMap.entrySet().iterator();
  
      @Override
      public boolean hasNext() {
          return i.hasNext();
      }
  
      @Override
      public String next() {
          return decompress(i.next().getValue());// error on this line
      }
  
      @Override
      public void remove() {
          i.remove();
      }
  }
  </code></pre>