title: How to compare two hash sets in java?
body: <p>How can I compare two hash sets in java ? My first hash sets looks like below.</p>
  
  <pre><code>static Set&lt;String&gt; nounPhrases = new HashSet&lt;&gt;();
  </code></pre>
  
  <p>Above hash set contains elements like this.</p>
  
  <p>List of Noun Parse : [java, jsp, book]</p>
  
  <p>2nd hash set </p>
  
  <pre><code>static Set&lt;String&gt; nounPhrases2 = new HashSet&lt;&gt;();
  </code></pre>
  
  <p>List of Noun Parse : [web, php, java,book]</p>
  
  <p>Note - I need to check if there are equal nouns in both sets. and if they have similar nouns then I need to do another task</p>