title: HashMap containsKey not returning true
body: <p>I am trying to compare the keys of my data in a hashmap to check if the data exists.  However, even when the key does exist in the array, containsKey will still return false.  I am using this:</p>
  
  <pre><code>package timeTraveler.core;
  
  import java.util.Arrays;
  
  public class StringArrayHolder
  {
      private final String[] data;
      //I do not want any client could change the array reference
      //this also explains why this field doesn't have a setter
      public StringArrayHolder(String[] data) 
      {
          this.data = data;
      }
      public String[] getData() 
      {
          return this.data;
      }
      @Override
      public int hashCode()
      {
          return Arrays.hashCode(data);
      }
      @Override
      public boolean equals(Object o)
      {
          if (o == null) 
          {
              System.out.println("NULL");
              return false;
          }
          if (o == this)
          {
              System.out.println("THIS");
              return true;
          }
  
          if (o instanceof StringArrayHolder) 
          {
              StringArrayHolder other = (StringArrayHolder)o;
              return Arrays.equals(this.data, other.data);
          }
          return false;
      }
      //just to print in console for testing purposes
      @Override
      public String toString() 
      {
          return Arrays.deepToString(data);
      }
  }
  </code></pre>
  
  <p>And my compare:</p>
  
  <pre><code>package timeTraveler.mechanics;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  import timeTraveler.core.StringArrayHolder;
  
  public class PathingData 
  {
      /**
       * Entity data array
       */
      public Map&lt;StringArrayHolder, List&lt;int[]&gt;&gt; allEntityData;
  
      public PathingData()
      {
          allEntityData = new HashMap&lt;StringArrayHolder, List&lt;int[]&gt;&gt;();
      }
      /**
       * Adds an entity identifier (NBT)and MobType to the entity data ArrayList.  If the entity already exists inside of the ArrayList, then it skips it.
       * @param uuid
       */
      public void addEntity(StringArrayHolder entityData)
      {       
          System.out.println(entityData);
          if(!allEntityData.containsKey(entityData))
          {
              System.out.println("Adding entity!");
              allEntityData.put(entityData, new ArrayList&lt;int[]&gt;());
          }
          else
          {
              System.out.println("ENTITY ALREADY EXISTS IN ARRAY");
          }
      }
      /**
       * Adds data (X, Y, and Z) to the corresponding identifier (NBT) for the entity.  If the entity's identifier does not exist, then it prints out a line that says the identifier cannot be found.
       * @param uuid
       * @param data
       */
      public void addData(StringArrayHolder entityData, String data)
      {
          System.out.println(entityData);
          if(allEntityData.containsKey(entityData))
          {
              System.out.println("Adding data to entity!");
              int[] rawData = new int[3];
              String[] pureData = data.split(",");
  
              rawData[0] = Integer.parseInt(pureData[0]);
              rawData[1] = Integer.parseInt(pureData[1]);
              rawData[2] = Integer.parseInt(pureData[2]);
  
              List&lt;int[]&gt; entityLocData = allEntityData.get(entityData);
              entityLocData.add(rawData);
              allEntityData.put(entityData, entityLocData);
          }
          else
          {
              System.out.println("ENTITY DOES NOT EXIST IN ARRAY! :(");
          }
      }
      /**
       * Gets the data for a specific UUID (Unique ID) for an entity.
       * @param uuid
       * @return
       */
      public List&lt;int[]&gt; getDataForIdentifier(StringArrayHolder entityData)
      {
          List&lt;int[]&gt; entityLoc = allEntityData.get(entityData);
          return entityLoc;
      }
      /**
       * Clears all entities and their corresponding data from the map.
       */
      public void clearAllEntitiesAndData()
      {
          allEntityData.clear();
      }
  
      /**
       * Checks if entity exists inside of array
       * @param entityData
       * @return
       */
      public boolean doesEntityExist(StringArrayHolder entityData)
      {
          System.out.println(entityData);
          if(allEntityData.containsKey(entityData) || allEntityData.containsValue(entityData))
          {
              System.out.println("ENTITYDOESEXISTINARRAY :)");
              return true;
          }
          System.out.println("ENTITY DOES NOT EXIXT IN ARRAY!  :(");
          return false;
      }
  
      @Override
      public String toString() 
      {
          return allEntityData.toString();
      }
  
  }
  </code></pre>
  
  <p>Area where doesEntityExist is called:</p>
  
  <pre><code>package timeTraveler.entities;
  
  import java.util.Random;
  import java.util.UUID;
  
  import timeTraveler.core.StringArrayHolder;
  import timeTraveler.core.TimeTraveler;
  import timeTraveler.gui.GuiTimeTravel;
  
  import net.minecraft.entity.Entity;
  import net.minecraft.entity.EntityLiving;
  import net.minecraft.entity.passive.EntityWolf;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.nbt.NBTTagCompound;
  import net.minecraftforge.event.ForgeSubscribe;
  import net.minecraftforge.event.entity.EntityJoinWorldEvent;
  
  public class EntityHandler 
  {
      boolean inPast;
  
      @ForgeSubscribe
      public void onEntityJoin(EntityJoinWorldEvent event)
      {
  
          inPast = GuiTimeTravel.isInPast;
  
          if(event.entity instanceof EntityLiving &amp;&amp; !(event.entity instanceof EntityPlayer))
          {
              NBTTagCompound entityData = event.entity.getEntityData();
              Random rand = new Random();
  
              if(entityData.getInteger("identifier") == 0)
              {
                  entityData.setInteger("identifier", rand.nextInt());
              }
  
              String[] data = new String[2];
  
              String identifier = Integer.toString(event.entity.getEntityData().getInteger("identifier"));
              String entityName = event.entity.getEntityName();
  
              data[0] = identifier;
              data[1] = entityName;
  
              StringArrayHolder d = new StringArrayHolder(data);
  
              if(inPast)
              {
                  System.out.println(data[0]);
                  System.out.println(data[1]);
                  System.out.println(d);
                  if(!TimeTraveler.vars.pathData.doesEntityExist(d))
                  {
                      System.out.println("REMOVING ENTITY");
  
                      //event.entity.setDead();
                  }
                  else
                  {
                      System.out.println(":)");
                  }
              }
          }
      }
  
  }
  </code></pre>
  
  <p>Specifically, doesEntityExist is always returning false.  the data does exist in the array, yet for some reason it still returns false.  Any ideas?</p>