Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java	(revision 14502)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java	(revision 14503)
@@ -5,4 +5,7 @@
 import org.junit.Test;
 import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager.UserInputTag;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -24,4 +27,16 @@
 
     /**
+     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/17064">#17064</a>.
+     */
+    @Test
+    public void testTicket17064() {
+        DataSet ds = new DataSet();
+        OsmDataLayer layer = new OsmDataLayer(ds, "testTicket17064", null);
+        MainApplication.getLayerManager().addLayer(layer);
+        AutoCompletionManager.of(ds);
+        MainApplication.getLayerManager().removeLayer(layer); // NPE in #17064
+    }
+
+    /**
      * Unit test of methods {@link UserInputTag#equals} and {@link UserInputTag#hashCode}.
      */
