title: Get Hashset Key
body: <pre><code>import java.util.HashMap;
  import java.util.HashSet;
  import java.util.Map;
  import java.util.Set;
  
  public static void printNumWordsDiscovered( HashMap&lt;String,Integer&gt; vocab, HashSet&lt;String&gt; dictionary ) {
          HashMap &lt;String,Integer&gt; Combine = new HashMap &lt;String,Integer&gt; ();
          Iterator iterVoc = vocab.entrySet().iterator();
          List&lt;String&gt; Dic = new ArrayList&lt;String&gt;();
          int i = 0;
          double actual =  0.0;
          double token = 0.0;
          while(iterVoc.hasNext()){
              Map.Entry iterVocE = (Map.Entry)iterVoc.next();
              if (dictionary.contains(iterVocE.getKey().toString())){
  
                  int Value =  (int) iterVocE.getValue();
                  actual += 1;
                  token  += Value;
                  Combine.put(iterVocE.getKey().toString(), Value);
  
              }
          }
          for(String s: dictionary.KeySet()){
              if (Combine.contains(dictionary.get(s).toString())){
                  System.out.println("Dicovered " + dictionary.get(s) + " ( count " + Combine.get(dictionary.get(s)) + " )");
              }
          }
  }
  </code></pre>
  
  <p>I am trying to iterate through a HashSet and I get errors concerning my .get() method. How do you get a key in a HashSet?</p>