I need some advide about user type with hashmap : <p>I wrote user type as below</p>

<pre><code>class Item {
   int first;
   int second;

   public boolean equals(Item p) {
       if(first == p.first &amp;&amp; second == p.second ) 
           return true;
       else if(first == p.second &amp;&amp; second == p.first)
           return true;
       else
           return false;
   }
   public int hashcode() {
       return Objects.hash(first, second);
   }
   public void set(Object first, Object second) {
       this.first = Integer.parseInt(first.toString());
       this.second = Integer.parseInt(second.toString());
   }
</code></pre>

<p>}</p>

<p>However, It doesn't work at all. Did I design the duplicate test incorrectly?</p>
