Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9754)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9755)
@@ -72,4 +72,5 @@
 import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.I18n;
+import org.openstreetmap.josm.tools.MultiMap;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
@@ -1397,13 +1398,5 @@
                 Entry e = (Entry) o;
                 Object evalue = e.getValue();
-                if (evalue instanceof Collection) {
-                    JsonArrayBuilder a = Json.createArrayBuilder();
-                    for (Object evo: (Collection) evalue) {
-                        a.add(evo.toString());
-                    }
-                    object.add(e.getKey().toString(), a.build());
-                } else {
-                    object.add(e.getKey().toString(), evalue.toString());
-                }
+                object.add(e.getKey().toString(), evalue.toString());
             }
             writer.writeObject(object.build());
@@ -1420,10 +1413,46 @@
             for (Entry<String, JsonValue> e: object.entrySet()) {
                 JsonValue value = e.getValue();
+                if (value instanceof JsonString) {
+                    // in some cases, when JsonValue.toString() is called, then additional quotation marks are left in value
+                    ret.put(e.getKey(), ((JsonString) value).getString());
+                } else {
+                    ret.put(e.getKey(), e.getValue().toString());
+                }
+            }
+        }
+        return ret;
+    }
+
+    @SuppressWarnings("rawtypes")
+    private static String multiMapToJson(MultiMap map) {
+        StringWriter stringWriter = new StringWriter();
+        try (JsonWriter writer = Json.createWriter(stringWriter)) {
+            JsonObjectBuilder object = Json.createObjectBuilder();
+            for (Object o: map.entrySet()) {
+                Entry e = (Entry) o;
+                Set evalue = (Set) e.getValue();
+                JsonArrayBuilder a = Json.createArrayBuilder();
+                for (Object evo: (Collection) evalue) {
+                    a.add(evo.toString());
+                }
+                object.add(e.getKey().toString(), a.build());
+            }
+            writer.writeObject(object.build());
+        }
+        return stringWriter.toString();
+    }
+
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    private static MultiMap multiMapFromJson(String s) {
+        MultiMap ret = null;
+        try (JsonReader reader = Json.createReader(new StringReader(s))) {
+            JsonObject object = reader.readObject();
+            ret = new MultiMap(object.size());
+            for (Entry<String, JsonValue> e: object.entrySet()) {
+                JsonValue value = e.getValue();
                 if (value instanceof JsonArray) {
-                    List<String> finalList = new ArrayList<String>();
                     for (JsonString js: ((JsonArray) value).getValuesAs(JsonString.class)) {
-                        finalList.add(js.getString());
+                        ret.put(e.getKey(), js.getString());
                     }
-                    ret.put(e.getKey(), finalList);
                 } else if (value instanceof JsonString) {
                     // in some cases, when JsonValue.toString() is called, then additional quotation marks are left in value
@@ -1475,4 +1504,6 @@
                         if (fieldValue instanceof Map) {
                             hash.put(key, mapToJson((Map) fieldValue));
+                        } else if (fieldValue instanceof MultiMap) {
+                            hash.put(key, multiMapToJson((MultiMap) fieldValue));
                         } else {
                             hash.put(key, fieldValue.toString());
@@ -1539,4 +1570,6 @@
             } else if (f.getType().isAssignableFrom(Map.class)) {
                 value = mapFromJson(key_value.getValue());
+            } else if (f.getType().isAssignableFrom(MultiMap.class)) {
+                value = multiMapFromJson(key_value.getValue());
             } else
                 throw new RuntimeException("unsupported preference primitive type");
Index: trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 9754)
+++ trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 9755)
@@ -13,4 +13,5 @@
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import java.util.TreeSet;
 import java.util.regex.Matcher;
@@ -32,4 +33,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.LanguageInfo;
+import org.openstreetmap.josm.tools.MultiMap;
 
 /**
@@ -219,6 +221,6 @@
         @pref String icon;
         @pref String description;
-        @pref Map<String, List<String>> noTileHeaders;
-        @pref Map<String, List<String>> noTileChecksums;
+        @pref MultiMap<String, String> noTileHeaders;
+        @pref MultiMap<String, String> noTileChecksums;
         @pref int tileSize = -1;
         @pref Map<String, String> metadataHeaders;
@@ -279,9 +281,9 @@
             }
             if (i.noTileHeaders != null && !i.noTileHeaders.isEmpty()) {
-                noTileHeaders = i.noTileHeaders;
+                noTileHeaders = new MultiMap<>(i.noTileHeaders);
             }
 
             if (i.noTileChecksums != null && !i.noTileChecksums.isEmpty()) {
-                noTileChecksums = i.noTileChecksums;
+                noTileChecksums = new MultiMap<>(i.noTileChecksums);
             }
 
@@ -412,8 +414,8 @@
         icon = e.icon;
         if (e.noTileHeaders != null) {
-            noTileHeaders = e.noTileHeaders;
+            noTileHeaders = e.noTileHeaders.toMap();
         }
         if (e.noTileChecksums != null) {
-            noTileChecksums = e.noTileChecksums;
+            noTileChecksums = e.noTileChecksums.toMap();
         }
         setTileSize(e.tileSize);
@@ -978,10 +980,14 @@
      * @since 9613
      */
-    public void setNoTileHeaders(Map<String, List<String>> noTileHeaders) {
-       this.noTileHeaders = noTileHeaders;
-    }
-
-    @Override
-    public Map<String, List<String>> getNoTileHeaders() {
+    public void setNoTileHeaders(MultiMap<String, String> noTileHeaders) {
+       if (noTileHeaders == null) {
+           this.noTileHeaders = null;
+       } else {
+            this.noTileHeaders = noTileHeaders.toMap();
+       }
+    }
+
+    @Override
+    public Map<String, Set<String>> getNoTileHeaders() {
         return noTileHeaders;
     }
@@ -994,10 +1000,14 @@
      * @since 9613
      */
-    public void setNoTileChecksums(Map<String, List<String>> noTileChecksums) {
-       this.noTileChecksums = noTileChecksums;
-    }
-
-    @Override
-    public Map<String, List<String>> getNoTileChecksums() {
+    public void setNoTileChecksums(MultiMap<String, String> noTileChecksums) {
+        if (noTileChecksums == null) {
+            this.noTileChecksums = null;
+        } else {
+            this.noTileChecksums = noTileChecksums.toMap();
+        }
+    }
+
+    @Override
+    public Map<String, Set<String>> getNoTileChecksums() {
         return noTileChecksums;
     }
Index: trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 9754)
+++ trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 9755)
@@ -23,4 +23,5 @@
 import org.openstreetmap.josm.tools.HttpClient;
 import org.openstreetmap.josm.tools.LanguageInfo;
+import org.openstreetmap.josm.tools.MultiMap;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.Attributes;
@@ -99,6 +100,6 @@
         private String lang;
         private List<String> projections;
-        private Map<String, List<String>> noTileHeaders;
-        private Map<String, List<String>> noTileChecksums;
+        private MultiMap<String, String> noTileHeaders;
+        private MultiMap<String, String> noTileChecksums;
         private Map<String, String> metadataHeaders;
 
@@ -132,6 +133,6 @@
                     skipEntry = false;
                     newState = State.ENTRY;
-                    noTileHeaders = new HashMap<>();
-                    noTileChecksums = new HashMap<>();
+                    noTileHeaders = new MultiMap<>();
+                    noTileChecksums = new MultiMap<>();
                     metadataHeaders = new HashMap<>();
                 }
@@ -196,24 +197,9 @@
                     mirrorEntry = new ImageryInfo();
                 } else if ("no-tile-header".equals(qName)) {
-                    String name = atts.getValue("name");
-                    List<String> l;
-                    if (noTileHeaders.containsKey(name)) {
-                        l = noTileHeaders.get(name);
-                    } else {
-                        l = new ArrayList<String>();
-                        noTileHeaders.put(atts.getValue("name"), l);
-                    }
-                    l.add(atts.getValue("value"));
+                    noTileHeaders.put(atts.getValue("name"), atts.getValue("value"));
                     newState = State.NO_TILE;
                 } else if ("no-tile-checksum".equals(qName)) {
                     String type = atts.getValue("type");
-                    List<String> l;
-                    if (noTileChecksums.containsKey(type)) {
-                        l = noTileChecksums.get(type);
-                    } else {
-                        l = new ArrayList<String>();
-                        noTileChecksums.put(type, l);
-                    }
-                    l.add(atts.getValue("value"));
+                    noTileChecksums.put(atts.getValue("type"), atts.getValue("value"));
                     newState = State.NO_TILESUM;
                 } else if ("metadata-header".equals(qName)) {
Index: trunk/src/org/openstreetmap/josm/tools/MultiMap.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/MultiMap.java	(revision 9754)
+++ trunk/src/org/openstreetmap/josm/tools/MultiMap.java	(revision 9755)
@@ -4,4 +4,5 @@
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
@@ -43,4 +44,19 @@
 
     /**
+     * Constructs a new {@code MultiMap} from an ordinary {@code Map}.
+     * @param map0 the {@code Map}
+     */
+    public MultiMap(Map<A, Set<B>> map0) {
+        if (map0 == null) {
+            map = new HashMap<>();
+        } else {
+            map = new HashMap<>(Utils.hashMapInitialCapacity(map0.size()));
+            for (Entry<A, Set<B>> e : map0.entrySet()) {
+                map.put(e.getKey(), new LinkedHashSet<>(e.getValue()));
+            }
+        }
+    }
+
+    /**
      * Map a key to a value.
      *
@@ -216,4 +232,16 @@
     public int hashCode() {
         return Objects.hash(map);
+    }
+
+    /**
+     * Converts this {@code MultiMap} to a {@code Map} with {@code Set} values.
+     * @return the converted {@code Map}
+     */
+    public Map<A, Set<B>> toMap() {
+        Map<A, Set<B>> result = new HashMap<>();
+        for (Entry<A, Set<B>> e : map.entrySet()) {
+            result.put(e.getKey(), Collections.unmodifiableSet(e.getValue()));
+        }
+        return result;
     }
 
