Index: trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java	(revision 13684)
+++ trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java	(revision 13699)
@@ -56,3 +56,17 @@
         }
     }
+
+    /**
+     * Non-regression test for bug #16248.
+     * @throws IOException if any I/O error occurs
+     * @throws WMSGetCapabilitiesException never
+     */
+    @Test
+    public void testTicket16248() throws IOException, WMSGetCapabilitiesException {
+        try (InputStream is = TestUtils.getRegressionDataStream(16248, "capabilities.xml")) {
+            WMSImagery wms = new WMSImagery();
+            wms.parseCapabilities(null, is);
+            assertEquals("http://wms.hgis.cartomatic.pl/topo/3857/m25k", wms.getServiceUrl().toExternalForm());
+        }
+    }
 }
