Fix map matches

Former-commit-id: 3f6e1ac4d321c181bd8a8c64e959d89963e1de1f
This commit is contained in:
Ghost_chu committed 2020-02-06 19:18:19 +08:00
1 parent 9f5442cae8
commit 28b7289922
1 file changed
+9 -1
@@ -1110,7 +1110,15 @@ public class Util {
* @return Map1 match Map2
*/
public static boolean mapMatches(@NotNull Map<?, ?> map1, @NotNull Map<?, ?> map2) {
return map2.entrySet().containsAll(map1.entrySet());
if(!map1.keySet().containsAll(map2.keySet())){
return false;
}
for (Object key : map1.keySet()){
if(!map2.get(key).equals(map1.get(key))){
return false;
}
}
return true;
}
/**