package com.box.boxjavalibv2.dao;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;

public class BoxHashMap<K, V> extends HashMap<K, V> {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @SuppressWarnings("unchecked")
    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        
        if (!(obj instanceof HashMap)){
            return false;
        }
        
        HashMap<K,Object> mapObj = (HashMap<K,Object>) obj;
        
        if (mapObj.size() != this.size()) {
            return false;
        }

        try {
            Iterator<Entry<K, Object>> i = mapObj.entrySet().iterator();
            while (i.hasNext()) {
                Entry<K, Object> e = i.next();
                Object key = e.getKey();
                Object value = e.getValue();
                if (value == null) {
                    if (!(get(key) == null && containsKey(key))) {
                        return false;
                    }
                }
                else {
                    if (value instanceof Object[]) {
                        if (!Arrays.equals((Object[]) value, (Object[]) (get(key)))) {
                            return false;
                        }
                    }
                    else if (!value.equals(get(key))) {
                        return false;
                    }

                }

            }
        }
        catch (ClassCastException e) {
            return false;
        }
        catch (NullPointerException e) {
            return false;
        }
        return true;

    }

    @Override
    public int hashCode() {
        int hashCode = 0;
        Iterator<java.util.Map.Entry<K, V>> i = entrySet().iterator();
        while (i.hasNext()){            
            Entry<K,V> entry = i.next();
            // ignore primitive arrays in our calculation of hashCode.
            if (! (entry.getValue() instanceof Object[])){
                hashCode += entry.hashCode();                
            }            
        }
        return hashCode;
    }


}

@@ -194,32 +194,8 @@
  %7B%0A%0A
-    /**%0A     * %0A     */%0A
     
@@ -391,32 +391,24 @@
 ;%0A        %7D%0A
-        
 %0A        if 
@@ -434,16 +434,17 @@
 ashMap))
+ 
 %7B%0A      
@@ -473,24 +473,16 @@
       %7D%0A
-        
 %0A       
@@ -488,24 +488,25 @@
   HashMap%3CK,
+ 
 Object%3E mapO
@@ -521,16 +521,17 @@
 shMap%3CK,
+ 
 Object%3E)
@@ -536,24 +536,16 @@
 %3E) obj;%0A
-        
 %0A       
@@ -1818,21 +1818,10 @@
 t())
-%7B           
  
+%7B
 %0A   
@@ -1837,16 +1837,17 @@
 Entry%3CK,
+ 
 V%3E entry
@@ -1947,17 +1947,16 @@
    if (!
- 
 (entry.g
@@ -1986,16 +1986,17 @@
 ject%5B%5D))
+ 
 %7B%0A      
@@ -2034,32 +2034,16 @@
 hCode();
-                
 %0A       
@@ -2048,28 +2048,16 @@
        %7D
-            
 %0A       
@@ -2088,14 +2088,13 @@
 de;%0A
+
     %7D%0A%0A
-%0A
 %7D%0A

Update formatting remove empty comment.