Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java	(revision 15908)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java	(revision 15909)
@@ -8,4 +8,5 @@
 import org.openstreetmap.josm.gui.mappaint.Environment;
 import org.openstreetmap.josm.gui.mappaint.StyleSource;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -48,5 +49,5 @@
          */
         public Declaration(List<Instruction> instructions, int idx) {
-            this.instructions = instructions;
+            this.instructions = Utils.toUnmodifiableList(instructions);
             this.idx = idx;
         }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 15908)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 15909)
@@ -537,9 +537,5 @@
 
         protected AbstractSelector(List<Condition> conditions) {
-            if (conditions == null || conditions.isEmpty()) {
-                this.conds = null;
-            } else {
-                this.conds = conditions;
-            }
+            this.conds = Utils.toUnmodifiableList(conditions);
         }
 
@@ -552,5 +548,4 @@
         public boolean matches(Environment env) {
             CheckParameterUtil.ensureParameterNotNull(env, "env");
-            if (conds == null) return true;
             for (Condition c : conds) {
                 try {
@@ -569,8 +564,5 @@
          */
         public List<Condition> getConditions() {
-            if (conds == null) {
-                return Collections.emptyList();
-            }
-            return Collections.unmodifiableList(conds);
+            return conds;
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java	(revision 15908)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java	(revision 15909)
@@ -89,10 +89,13 @@
         public int classification;
         public int favoriteIndex;
-        private final Collection<String> groups = new HashSet<>();
-        private final Collection<String> names = new HashSet<>();
-        private final Collection<String> tags = new HashSet<>();
+        private final Collection<String> groups;
+        private final Collection<String> names;
+        private final Collection<String> tags;
 
         PresetClassification(TaggingPreset preset) {
             this.preset = preset;
+            Set<String> groups = new HashSet<>();
+            Set<String> names = new HashSet<>();
+            Set<String> tags = new HashSet<>();
             TaggingPreset group = preset.group;
             while (group != null) {
@@ -119,4 +122,7 @@
                 }
             }
+            this.groups = Utils.toUnmodifiableList(groups);
+            this.names = Utils.toUnmodifiableList(names);
+            this.tags = Utils.toUnmodifiableList(tags);
         }
 
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 15908)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 15909)
@@ -748,4 +748,25 @@
 
     /**
+     * Returns an unmodifiable list for the given collection.
+     * Makes use of {@link Collections#emptySet()} and {@link Collections#singleton} and {@link Arrays#asList} to save memory.
+     * @param  collection the collection for which an unmodifiable collection is to be returned
+     * @param <T> the class of the objects in the array
+     * @return an unmodifiable list
+     * @see <a href="https://dzone.com/articles/preventing-your-java-collections-from-wasting-memo">
+     *     How to Prevent Your Java Collections From Wasting Memory</a>
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> List<T> toUnmodifiableList(Collection<T> collection) {
+        // Java 9: use List.of(...)
+        if (collection == null || collection.isEmpty()) {
+            return Collections.emptyList();
+        } else if (collection.size() == 1) {
+            return Collections.singletonList(collection.iterator().next());
+        } else {
+            return (List<T>) Arrays.asList(collection.toArray());
+        }
+    }
+
+    /**
      * Returns the first not empty string in the given candidates, otherwise the default string.
      * @param defaultString default string returned if all candidates would be empty if stripped
