diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java b/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
index 2a9bb5147..74efeef3a 100644
--- a/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
+++ b/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
@@ -244,6 +244,21 @@ public final class ExpressionFactory {
             return null;
         }
 
+        /**
+         * Test wheather the list {@code lst} contains the {@code str} element.
+         * @param lst list
+         * @param str String
+         * @return true if {@code str} is contained
+         */
+        public static boolean contains(String str, List<?> lst) { // NO_UCD (unused code)
+            for (int i = 0; i < lst.size(); i++) {
+                if (lst.get(i).equals(str)) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
         /**
          * Splits string {@code toSplit} at occurrences of the separator string {@code sep} and returns a list of matches.
          * @param sep separator string
