title: Need proper hashCode when comparing Object with unordered pair of integers as variables
body: <p>I have a class</p>
  
  <pre><code>final class BuildingPair {
  
      int mBA;
      int mBB;
  
      public BuildingPair(int pBuildingA,int pBuildingB) {
          mBA = pBuildingA;
          mBB = pBuildingB;
      }
  
      @Override
      public int hashCode() {
          final int prime = 31;
          int result = 1;
          result = prime * result + mBA;
          result = prime * result + mBB;
          return result;
      }
  
      @Override
      public boolean equals(Object obj) {
          if (this == obj)
              return true;
          if (obj == null)
              return false;
          if (getClass() != obj.getClass())
              return false;
          BuildingPair other = (BuildingPair) obj;
          if ((mBA==other.mBA&amp;&amp;mBB==other.mBB)||(mBA==other.mBB&amp;&amp;mBB==other.mBA)) return true;
          return false;
      }
  }
  </code></pre>
  
  <p>I want to compare two objects , and when both have the same buildings ids they are equal </p>
  
  <p>so they need to be equal in both directions when : </p>
  
  <pre><code>BuildingPair(1,2) vs BuildingPair(2,1) 
  BuildingPair(1,2) vs BuildingPair(1,2)
  BuildingPair(2,1) vs BuildingPair(1,2)
  </code></pre>
  
  <p>i think equals method is ok, but hashcode is wrong.</p>