title: Java 8 stream reverse order
body: <p>General question: What's the proper way to reverse a stream? Assuming that we don't know what type of elements that stream consists of, what's the generic way to reverse any stream?</p>
  
  <p>Specific question: </p>
  
  <p><code>IntStream</code> provides range method to generate Integers in specific range <code>IntStream.range(-range, 0)</code>, now that I want to reverse it switching range from 0 to negative won't work, also I can't use <code>Integer::compare</code></p>
  
  <pre><code>List&lt;Integer&gt; list = Arrays.asList(1,2,3,4);
  list.stream().sorted(Integer::compare).forEach(System.out::println);
  </code></pre>
  
  <p>with <code>IntStream</code> I'll get this compiler error</p>
  
  <blockquote>
    <p>Error:(191, 0) ajc: The method <code>sorted()</code> in the type <code>IntStream</code> is not applicable for the arguments (<code>Integer::compare</code>)</p>
  </blockquote>
  
  <p>what am I missing here?</p>