title: Cannot resolve method spliterator JSONArray java8 streams
body: <p>I am trying to use streams on a JSONArray (imported from org.json.JSONArray) (following another stackoverflow thread here: <a href="https://stackoverflow.com/questions/42854505/how-to-iterate-over-a-jsonarray-in-java-8">How to iterate over a jsonarray in java8</a>.
  However, my IDE (intellij) complains that it cannot resolve the method spliterator.
  What am I missing? I can't find any solution online.
  Below is the code:</p>
  
  <pre><code>private static Stream&lt;Object&gt; arrayToStream(JSONArray array) {
      return StreamSupport.stream(array.spliterator(), false);
  }
  </code></pre>
  
  <p>Below in the screenshot, you can see the error the IDE is showing me:
  <a href="https://i.stack.imgur.com/I4BYZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I4BYZ.png" alt="enter image description here"></a></p>