title: Partially sort an array in descending order using Java Stream API
body: <p>I need to know how to partially sort an array of primitive unique integers in descending order using Stream API. For example, if there is an array like <code>{1,2,3,4,5}</code>, I want to get <code>{5,4,3, 1,2}</code> - 3 biggest elements first and then the rest. Is it even possible using streams? I checked the docs - there are two methods <code>skip</code> and <code>limit</code> but they change the stream content and work from the beginning of the array.</p>
  
  <p>I can sort the whole array like</p>
  
  <pre><code>Arrays.stream(arr)
  .boxed()
  .sorted(Collections.reverseOrder())
  .mapToInt(Integer::intValue)
  .toArray();
  </code></pre>
  
  <p>but how to make this sorting partial? I said Stream API because I want it to be written nicely. </p>
  
  <p>Also I intuitively feel that <code>concat</code> may have a go here. Another approach I could think about - is to use a custom comparator limiting the number of sorted elements. What do you think?</p>
  
  <p>P.S. I am not a Java expert.</p>