title: Hashmap get(key) returns null even when the value is present
body: <p>I'm trying to save datas in a hash map and retrieve it. The value corresponding to the key is present and it still returns null. I have implemented the equals() and hashCode() methods also. </p>
  
  <pre><code>ArrayList&lt;Friends&gt; friendsArrayList = new ArrayList&lt;Friends&gt;();
  HashMap&lt;Friends,ArrayList&lt;FriendDetails&gt;&gt; friendDetailsHashMap = new HashMap&lt;Friends, ArrayList&lt;FriendDetails&gt;&gt;();
  int mSelectedIndex = 0;
  ...
  Friends f = friendsArrayList.get(mSelectedIndex);
  ArrayList&lt;MeterGroups&gt; temp2 = friendDetailsHashMap.get(mp); //&lt;== This is where it returns null
  </code></pre>
  
  <p>My ObjectClass Friends.java:</p>
  
  <pre><code>import java.io.Serializable;
  
  public class Friends implements Serializable {
  private String friendName;
  private String friendId;
  private double distanceFromCurrentLocation;
  
  public Friends(String name, String id)
  {
      this.friendName = name;
      this.friendId = id;
      this.distanceFromCurrentLocation = getDistanceFromCurrentLocation();
  
  }
  
  public String getFriendName(){
      return friendName;
  }
  
  public void setFriendName(String name){
      this.friendName = name;
  }
  
  public void setFriendId(String id){
      this.friendId = id;
  }
  public String getFriendId(){
      return friendId;
  }
  
  public double getDistanceFromCurrentLocation(){
      return 0.0;
  }
  
  public int hashCode(){
      return friendName.hashCode()*friendId.hashCode();
  }
  
  public boolean equals(Object o){
      if(o == null) {
          return false;
      }
      if(!(o instanceof Friends)) {
          return false;
      }
  
      Friends other = (Friends) o;
      return this.friendId == other.friendId; //friendId is a unique value
     }
  }
  </code></pre>