Here you can find the source of mapEquals(Map
public static <K, V> boolean mapEquals(Map<K, V> leftMap, Map<K, V> rightMap)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { public static <K, V> boolean mapEquals(Map<K, V> leftMap, Map<K, V> rightMap) { if (leftMap == null || rightMap == null || leftMap.size() != rightMap.size()) return false; for (K key : leftMap.keySet()) { V value1 = leftMap.get(key); V value2 = rightMap.get(key); if (!value1.equals(value2)) return false; }//w w w . j av a 2 s. co m return true; } }