Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java	(revision 14149)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java	(revision 14153)
@@ -659,5 +659,4 @@
     /* PropertyChangeListener                                                        */
     /* ----------------------------------------------------------------------------- */
-    @SuppressWarnings("unchecked")
     @Test
     public void testAddPropertyChangeListener() throws ReflectiveOperationException {
@@ -675,5 +674,4 @@
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testRemovePropertyChangeListener() throws ReflectiveOperationException {
@@ -711,4 +709,5 @@
             public ArrayList<PropertyChangeEvent> events = new ArrayList<>();
 
+            @Override
             public void propertyChange(PropertyChangeEvent evt) {
                 events.add(evt);
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java	(revision 14149)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java	(revision 14153)
@@ -9,5 +9,4 @@
 
 import java.awt.Component;
-import java.awt.Window;
 import java.io.File;
 import java.nio.file.Files;
@@ -21,5 +20,4 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Preferences;
@@ -69,8 +67,4 @@
     @Before
     public void setUp() throws ReflectiveOperationException {
-        if (!java.awt.GraphicsEnvironment.isHeadless()) {
-            originalMainParent = Main.parent;
-            Main.parent = new Window(null);
-        }
 
         // some other tests actually go ahead and load plugins (notably at time of writing,
@@ -120,13 +114,7 @@
         pluginList.clear();
         pluginList.addAll(this.originalPluginList);
-
-        if (!java.awt.GraphicsEnvironment.isHeadless()) {
-            Main.parent = originalMainParent;
-        }
     }
 
     private Collection<PluginProxy> originalPluginList;
-
-    private Component originalMainParent;
 
     private File pluginDir;
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java	(revision 14149)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java	(revision 14153)
@@ -15,7 +15,7 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Preferences;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -115,5 +115,5 @@
 
         final List<PluginInformation> updatedPlugins = PluginHandler.updatePlugins(
-            Main.parent,
+            MainApplication.getMainFrame(),
             null,
             null,
@@ -183,5 +183,5 @@
 
         final List<PluginInformation> updatedPlugins = PluginHandler.updatePlugins(
-            Main.parent,
+            MainApplication.getMainFrame(),
             null,
             null,
@@ -257,5 +257,5 @@
 
         final List<PluginInformation> updatedPlugins = ImmutableList.copyOf(PluginHandler.updatePlugins(
-            Main.parent,
+            MainApplication.getMainFrame(),
             null,
             null,
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java	(revision 14149)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java	(revision 14153)
@@ -13,6 +13,6 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.preferences.plugin.PluginPreferenceTest;
 import org.openstreetmap.josm.plugins.PluginHandler.DeprecatedPlugin;
@@ -73,5 +73,5 @@
     public void testFilterDeprecatedPlugins() {
         List<String> plugins = new ArrayList<>(Arrays.asList("foo", "bar", "imagery"));
-        PluginHandler.filterDeprecatedPlugins(Main.parent, plugins);
+        PluginHandler.filterDeprecatedPlugins(MainApplication.getMainFrame(), plugins);
         assertEquals(2, plugins.size());
         assertFalse(plugins.contains("imagery"));
@@ -84,5 +84,5 @@
     public void testFilterUnmaintainedPlugins() {
         List<String> plugins = new ArrayList<>(Arrays.asList("foo", "bar", "gpsbabelgui"));
-        PluginHandler.filterUnmaintainedPlugins(Main.parent, plugins);
+        PluginHandler.filterUnmaintainedPlugins(MainApplication.getMainFrame(), plugins);
         assertEquals(2, plugins.size());
         assertFalse(plugins.contains("gpsbabelgui"));
Index: trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 14149)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 14153)
@@ -22,5 +22,4 @@
 import org.junit.runners.model.Statement;
 import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.DeleteAction;
Index: trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java	(revision 14149)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java	(revision 14153)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.testutils;
+
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
 
 import java.io.File;
@@ -12,12 +14,10 @@
 import java.util.stream.Collectors;
 
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.tools.Logging;
 
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-import com.google.common.collect.ImmutableList;
-
+import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.client.MappingBuilder;
 import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
@@ -25,7 +25,5 @@
 import com.github.tomakehurst.wiremock.core.Options;
 import com.github.tomakehurst.wiremock.junit.WireMockRule;
-import com.github.tomakehurst.wiremock.WireMockServer;
-
-import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
+import com.google.common.collect.ImmutableList;
 
 public class PluginServer {
@@ -75,5 +73,5 @@
 
         public String getRemotePluginsListManifestSection() {
-            final Map<String, String> attrs = new HashMap<String, String>();
+            final Map<String, String> attrs = new HashMap<>();
             JarFile jarFile = null;
 
@@ -239,5 +237,4 @@
             return super.apply(new Statement() {
                 @Override
-                @SuppressWarnings("unchecked")
                 public void evaluate() throws Throwable {
                     PluginServer.this.applyToWireMockServer(PluginServerRule.this);
