title: Generate Set of Integers through HashSet using Java Streams
body: <p>I was trying to create a HashSet by get all keys of a HashMap whose values are greater than 0. To do so, i considered Java Streams, something with Collectors, but without success. The only way i got success was using a forEach loop with an if statement inside, described in the code below:</p>
  
  <pre><code>HashMap&lt;Integer, Double&gt; profiencyOnSkill;
  HashSet&lt;Integer&gt; skills;
  
  profiencyOnSkill.put(1, 0.5);
  profiencyOnSkill.put(2, 0.0);
  profiencyOnSkill.put(3, 1.0);
  profiencyOnSkill.put(4, 0.02);
  profiencyOnSkill.put(5, 0.0);
  
  profiencyOnSkill
              .entrySet()
              .stream()
              .forEach(pair -&gt; {
                  if (pair.getValue() &gt; 0.0) {
                      skills.add(pair.getKey());
                  }
              });
  
  skills.forEach(System.out::println);
  </code></pre>
  
  <p>Is there any direct way to do with Collectors? All my ideas with Collectors returned a <code>Map.Entry&lt;Integer, Double&gt;</code>. Something like that: </p>
  
  <pre><code>Set&lt;Map.Entry&lt;Integer, Double&gt;&gt; someSet = proficiencyOnSkill.entrySet().stream().filter(x-&gt; x.getValue() == 2).collect(Collectors.toSet());
  </code></pre>