Here you can find the source of equals(Map
static boolean equals(Map<String, String[]> map1, Map<String, String[]> map2)
//package com.java2s; /*/*from w ww . ja va 2 s .co m*/ * Copyright (C) 2010 eXo Platform SAS. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ import java.util.Arrays; import java.util.Map; public class Main { static boolean equals(Map<String, String[]> map1, Map<String, String[]> map2) { if (map1.keySet().equals(map2.keySet())) { for (Map.Entry<String, String[]> parameter : map1.entrySet()) { String[] thatParameterValues = map2.get(parameter.getKey()); if (thatParameterValues != null) { if (!Arrays.equals(parameter.getValue(), thatParameterValues)) { return false; } } } return true; } return false; } }