title: type lost when using java8 stream api
body: <p>code first:</p>
  
  <pre><code>    net.sf.json.JSONArray ja = new net.sf.json.JSONArray();
      for (int i = 0; i &lt; 3; i++) {
          net.sf.json.JSONObject obj = new net.sf.json.JSONObject();
          obj.put("number", "k"+i);
          ja.add(obj);
      }
      System.out.println(ja.stream().map(s-&gt;((net.sf.json.JSONObject)s).getString("number")).peek(s-&gt;System.out.println(s.getClass())).collect(Collectors.joining(";")));
  </code></pre>
  
  <p>as you can see, I try to get a <code>String</code> of <code>JSONObject</code> and join them. And it works above like this:</p>
  
  <pre><code>    class java.lang.String
      class java.lang.String
      class java.lang.String
      k0;k1;k2
  </code></pre>
  
  <p>However <code>ja.stream().map(s-&gt;((JSONObject)s).getString("number"))</code> seems return not a <code>Stream&lt;String&gt;</code> but <code>Stream&lt;Object&gt;</code> which I couldn't append <code>String</code> intermidiate operation like <code>.map(s-&gt;s.substring(3))</code>. In other words, type lost. </p>
  
  <p>So can anybody give any advice?</p>