title: Converting list to set using java 8
body: <p>Recently I came across the new syntax of Java 8 that can be used to convert a list to a set:</p>
  
  <pre><code>Set&lt;Integer&gt; myset = mylist.stream().collect(Collectors.toSet()));
  </code></pre>
  
  <p>I would like to know the advantage of using this approach to convert a list to a set over the traditional way (by passing it as a argument to HashSet.)</p>