Index: src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java	(revision 15322)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java	(working copy)
@@ -571,6 +571,26 @@
     }
 
     /**
+     * Get unique values
+     * @param values A list of values that may have duplicates
+     * @return A list with no duplicates
+     * @since xxx
+     */
+    public static List<String> uniq(String... values) {
+        return uniq_list(Arrays.asList(values));
+    }
+
+    /**
+     * Get unique values
+     * @param values A list of values that may have duplicates
+     * @return A list with no duplicates
+     * @since xxx
+     */
+    public static List<String> uniq_list(List<String> values) {
+        return values.stream().distinct().collect(Collectors.toList());
+    }
+
+    /**
      * Returns the role of current object in parent relation, or role of child if current object is a relation.
      * @param env the environment
      * @return role of current object in parent relation, or role of child if current object is a relation
Index: test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java
===================================================================
--- test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java	(revision 15322)
+++ test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java	(working copy)
@@ -465,6 +465,14 @@
     }
 
     @Test
+    public void testUniqueValues() throws Exception {
+        assertEquals(Arrays.asList(new String[] {"alpha", "beta"}),
+                Functions.uniq("alpha", "alpha", "alpha", "beta"));
+        assertEquals(Arrays.asList(new String[] {"one", "two", "three"}),
+                Functions.uniq_list(Arrays.asList(new String[] {"one", "one", "two", "two", "two", "three"})));
+    }
+
+    @Test
     public void testCountRoles() throws Exception {
         DataSet ds = new DataSet();
         Way way1 = TestUtils.newWay("highway=residential name=1",
