Index: trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 11814)
+++ trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 11815)
@@ -246,4 +246,10 @@
             return new WMTSDefaultLayer(selectedLayer.identifier, selectedLayer.tileMatrixSet.identifier);
         }
+
+        private static List<Entry<String, List<Layer>>> groupLayersByNameAndTileMatrixSet(Collection<Layer> layers) {
+            Map<String, List<Layer>> layerByName = layers.stream().collect(
+                    Collectors.groupingBy(x -> x.identifier + '\u001c' + x.tileMatrixSet.identifier));
+            return layerByName.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors.toList());
+        }
     }
 
@@ -258,5 +264,4 @@
 
     private final WMTSDefaultLayer defaultLayer;
-
 
     /**
@@ -313,10 +318,4 @@
         matcher.appendTail(output);
         return output.toString();
-    }
-
-    private static List<Entry<String, List<Layer>>> groupLayersByNameAndTileMatrixSet(Collection<Layer> layers) {
-        Map<String, List<Layer>> layerByName = layers.stream().collect(
-                Collectors.groupingBy(x -> x.identifier + '\u001c' + x.tileMatrixSet.identifier));
-        return layerByName.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors.toList());
     }
 
