title: Java - Type mismatch: cannot convert from element type Object to String
body: <p>I'm having this error:</p>
  
  <blockquote>
    <p>Type mismatch: cannot convert from element type Object to String</p>
  </blockquote>
  
  <p>This is the code in error:</p>
  
  <pre><code>public List&lt;String&gt; customPrefixes(PermissionUser u)
  {
      List returnlist = new ArrayList();
      for (String k : u.getAllPermissions().keySet()) {
          List perms = (List)u.getAllPermissions().get(k);
          for (String s : perms) {
              String[] split = s.split(".");
              if ((split.length &gt;= 3) &amp;&amp; 
                (split[0].equalsIgnoreCase("plugin")) &amp;&amp; 
                (split[1].equalsIgnoreCase("prefix"))) {
                  returnlist.add(split[2]);
              }
          }
      }
      return returnlist;
  }
  </code></pre>