title: Java: How to get n elements from a set
body: <p>I was trying to find the most elegant way to get the n elements from a set starting from x. What I concluded was using streams:</p>
  
  <pre><code>Set&lt;T&gt; s;
  Set&lt;T&gt; subS = s.stream().skip(x).limit(n).collect(Collectors.toSet());
  </code></pre>
  
  <p>Is this the best way to do it this way? Are there any drawbacks? </p>