@Test public void testParameterMapClone() { final ParameterMap m1 = new ParameterMap(); m1.put("foo", new String[] {"b1", "b2"}); m1.put("bar", new String[0]); final ParameterMap m2 = new ParameterMap(m1); assertTrue(m2.equals(m1)); }
@Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Map<?, ?>)) return false; Map<?, ?> m = (Map<?, ?>) o; if (m.size() != size()) return false; try { Iterator<Entry<String, String[]>> i = entrySet().iterator(); while (i.hasNext()) { Entry<String, String[]> e = i.next(); String key = e.getKey(); String[] value = e.getValue(); if (value == null) { if (!(m.get(key) == null && m.containsKey(key))) return false; } else { final Object oValue = m.get(key); if (value != oValue) { if (oValue == null || !(oValue instanceof String[])) return false; if (!Arrays.equals(value, (String[]) oValue)) return false; } } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; }
ParameterMap extends LinkedHashMap<String, String[]> { @Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Map<?, ?>)) return false; Map<?, ?> m = (Map<?, ?>) o; if (m.size() != size()) return false; try { Iterator<Entry<String, String[]>> i = entrySet().iterator(); while (i.hasNext()) { Entry<String, String[]> e = i.next(); String key = e.getKey(); String[] value = e.getValue(); if (value == null) { if (!(m.get(key) == null && m.containsKey(key))) return false; } else { final Object oValue = m.get(key); if (value != oValue) { if (oValue == null || !(oValue instanceof String[])) return false; if (!Arrays.equals(value, (String[]) oValue)) return false; } } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; } }
ParameterMap extends LinkedHashMap<String, String[]> { @Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Map<?, ?>)) return false; Map<?, ?> m = (Map<?, ?>) o; if (m.size() != size()) return false; try { Iterator<Entry<String, String[]>> i = entrySet().iterator(); while (i.hasNext()) { Entry<String, String[]> e = i.next(); String key = e.getKey(); String[] value = e.getValue(); if (value == null) { if (!(m.get(key) == null && m.containsKey(key))) return false; } else { final Object oValue = m.get(key); if (value != oValue) { if (oValue == null || !(oValue instanceof String[])) return false; if (!Arrays.equals(value, (String[]) oValue)) return false; } } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; } ParameterMap();  ParameterMap(int initialCapacity, float loadFactor, boolean accessOrder);  ParameterMap(int initialCapacity, float loadFactor);  ParameterMap(int initialCapacity);  ParameterMap(Map<? extends String, ? extends String[]> m); }
ParameterMap extends LinkedHashMap<String, String[]> { @Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Map<?, ?>)) return false; Map<?, ?> m = (Map<?, ?>) o; if (m.size() != size()) return false; try { Iterator<Entry<String, String[]>> i = entrySet().iterator(); while (i.hasNext()) { Entry<String, String[]> e = i.next(); String key = e.getKey(); String[] value = e.getValue(); if (value == null) { if (!(m.get(key) == null && m.containsKey(key))) return false; } else { final Object oValue = m.get(key); if (value != oValue) { if (oValue == null || !(oValue instanceof String[])) return false; if (!Arrays.equals(value, (String[]) oValue)) return false; } } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; } ParameterMap();  ParameterMap(int initialCapacity, float loadFactor, boolean accessOrder);  ParameterMap(int initialCapacity, float loadFactor);  ParameterMap(int initialCapacity);  ParameterMap(Map<? extends String, ? extends String[]> m); Map<String, List<String>> toListMap(); static Map<String, List<String>> convertArrayMap(Map<String, String[]> parameterMap); static ParameterMap convertListMap(Map<String, List<String>> parameterMap); static Map<String, List<String>> immutableCopyOfListMap(
            Map<String, List<String>> parameterMap); static Map<String, List<String>> immutableCopyOfArrayMap(
            Map<String, String[]> parameterMap); static void putAllList(Map<String, List<String>> dest, Map<String, String[]> src); static void putAllArray(Map<String, String[]> dest, Map<String, List<String>> src); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
ParameterMap extends LinkedHashMap<String, String[]> { @Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Map<?, ?>)) return false; Map<?, ?> m = (Map<?, ?>) o; if (m.size() != size()) return false; try { Iterator<Entry<String, String[]>> i = entrySet().iterator(); while (i.hasNext()) { Entry<String, String[]> e = i.next(); String key = e.getKey(); String[] value = e.getValue(); if (value == null) { if (!(m.get(key) == null && m.containsKey(key))) return false; } else { final Object oValue = m.get(key); if (value != oValue) { if (oValue == null || !(oValue instanceof String[])) return false; if (!Arrays.equals(value, (String[]) oValue)) return false; } } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; } ParameterMap();  ParameterMap(int initialCapacity, float loadFactor, boolean accessOrder);  ParameterMap(int initialCapacity, float loadFactor);  ParameterMap(int initialCapacity);  ParameterMap(Map<? extends String, ? extends String[]> m); Map<String, List<String>> toListMap(); static Map<String, List<String>> convertArrayMap(Map<String, String[]> parameterMap); static ParameterMap convertListMap(Map<String, List<String>> parameterMap); static Map<String, List<String>> immutableCopyOfListMap(
            Map<String, List<String>> parameterMap); static Map<String, List<String>> immutableCopyOfArrayMap(
            Map<String, String[]> parameterMap); static void putAllList(Map<String, List<String>> dest, Map<String, String[]> src); static void putAllArray(Map<String, String[]> dest, Map<String, List<String>> src); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }