Index: trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 10347)
+++ trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 10364)
@@ -124,5 +124,5 @@
                 Main.main.createMapFrame(null, null);
             } else {
-                for (Layer l: Main.map.mapView.getAllLayers()) {
+                for (Layer l: Main.getLayerManager().getLayers()) {
                     Main.map.mapView.removeLayer(l);
                 }
Index: trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 10347)
+++ trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 10364)
@@ -47,7 +47,7 @@
     @Test
     public void testActionPerformedEnabled() {
-        assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty());
+        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
         new AddImageryLayerAction(new ImageryInfo("foo_tms", "http://bar", "tms", null, null)).actionPerformed(null);
-        List<TMSLayer> tmsLayers = Main.map.mapView.getLayersOfType(TMSLayer.class);
+        List<TMSLayer> tmsLayers = Main.getLayerManager().getLayersOfType(TMSLayer.class);
         assertEquals(1, tmsLayers.size());
 
@@ -55,5 +55,5 @@
             new AddImageryLayerAction(new ImageryInfo("wms.openstreetmap.fr", "http://wms.openstreetmap.fr/wms?",
                     "wms_endpoint", null, null)).actionPerformed(null);
-            List<WMSLayer> wmsLayers = Main.map.mapView.getLayersOfType(WMSLayer.class);
+            List<WMSLayer> wmsLayers = Main.getLayerManager().getLayersOfType(WMSLayer.class);
             assertEquals(1, wmsLayers.size());
 
@@ -69,7 +69,7 @@
     @Test
     public void testActionPerformedDisabled() {
-        assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty());
+        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
         new AddImageryLayerAction(new ImageryInfo()).actionPerformed(null);
-        assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty());
+        assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java	(revision 10347)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java	(revision 10364)
@@ -51,5 +51,5 @@
     @Test
     public void testExecuteUndoCommand() {
-        OsmDataLayer layer = Main.map.mapView.getEditLayer();
+        OsmDataLayer layer = Main.getLayerManager().getEditLayer();
         Conflict<Node> conflict = new Conflict<>(new Node(), new Node());
         ConflictAddCommand cmd = new ConflictAddCommand(layer, conflict);
@@ -67,5 +67,5 @@
     @Test
     public void testGetDescriptionIcon() {
-        OsmDataLayer layer = Main.map.mapView.getEditLayer();
+        OsmDataLayer layer = Main.getLayerManager().getEditLayer();
         Conflict<Node> conflict = new Conflict<>(new Node(), new Node());
         assertNotNull(new ConflictAddCommand(layer, conflict).getDescriptionIcon());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java	(revision 10347)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java	(revision 10364)
@@ -49,5 +49,5 @@
                         gpxLayer).run();
                 assertEquals(2, Main.map.mapView.getNumLayers());
-                GeoImageLayer layer = Main.map.mapView.getLayersOfType(GeoImageLayer.class).iterator().next();
+                GeoImageLayer layer = Main.getLayerManager().getLayersOfType(GeoImageLayer.class).iterator().next();
                 try {
                     assertEquals(gpxLayer, layer.getGpxLayer());
Index: trunk/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java	(revision 10347)
+++ trunk/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java	(revision 10364)
@@ -23,5 +23,5 @@
     public void testTicket12531() {
         if (Main.map != null) {
-            for (Layer l: Main.map.mapView.getAllLayers()) {
+            for (Layer l: Main.getLayerManager().getLayers()) {
                 Main.map.mapView.removeLayer(l);
             }
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java	(revision 10347)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java	(revision 10364)
@@ -95,5 +95,5 @@
             newHandler("https://localhost?url=" + Utils.encodeUrl(url)).handle();
         } finally {
-            for (OsmDataLayer layer : Main.map.mapView.getLayersOfType(OsmDataLayer.class)) {
+            for (OsmDataLayer layer : Main.getLayerManager().getLayersOfType(OsmDataLayer.class)) {
                 Main.main.removeLayer(layer);
             }
Index: trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 10347)
+++ trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 10364)
@@ -139,5 +139,5 @@
     public void testReadNotes() throws IOException, IllegalDataException {
         if (Main.isDisplayingMapView()) {
-            for (NoteLayer nl : Main.map.mapView.getLayersOfType(NoteLayer.class)) {
+            for (NoteLayer nl : Main.getLayerManager().getLayersOfType(NoteLayer.class)) {
                 Main.map.mapView.removeLayer(nl);
             }
