Index: /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 12220)
+++ /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 12221)
@@ -150,13 +150,7 @@
         assertNull(Main.getLayerManager().getActiveLayer());
 
-        if (Main.contentPanePrivate == null) {
-            Main.contentPanePrivate = new JPanel(new BorderLayout());
-        }
-        if (Main.mainPanel == null) {
-            Main.mainPanel = new MainPanel(Main.getLayerManager());
-        }
-        if (Main.toolbar == null) {
-            Main.toolbar = new ToolbarPreferences();
-        }
+        initContentPane();
+        initMainPanel();
+        initToolbar();
         if (Main.main == null) {
             new MainApplication().initialize();
@@ -167,3 +161,30 @@
         Main.getLayerManager().addLayer(new TestLayer());
     }
+
+    /**
+     * Make sure {@code Main.contentPanePrivate} is initialized.
+     */
+    public static void initContentPane() {
+        if (Main.contentPanePrivate == null) {
+            Main.contentPanePrivate = new JPanel(new BorderLayout());
+        }
+    }
+
+    /**
+     * Make sure {@code Main.mainPanel} is initialized.
+     */
+    public static void initMainPanel() {
+        if (Main.mainPanel == null) {
+            Main.mainPanel = new MainPanel(Main.getLayerManager());
+        }
+    }
+
+    /**
+     * Make sure {@code Main.toolbar} is initialized.
+     */
+    public static void initToolbar() {
+        if (Main.toolbar == null) {
+            Main.toolbar = new ToolbarPreferences();
+        }
+    }
 }
