Subject: [PATCH] See #16567: Update to JUnit 5

This converts most tests to use @Annotations. There are also some performance
improvements as it relates to tests.
---
Index: src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java b/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
--- a/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 18861)
+++ b/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(date 1696525315898)
@@ -457,7 +457,7 @@
 
                     List<Way> prims = Arrays.asList(es1.getWay(), es2.getWay());
                     if ((highlight = crossingWays.get(prims)) == null) {
-                        highlight = new ArrayList<>();
+                        highlight = new ArrayList<>(2);
                         highlight.add(es1);
                         highlight.add(es2);
                         crossingWays.put(prims, highlight);
Index: src/org/openstreetmap/josm/data/validation/ValidatorCLI.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/validation/ValidatorCLI.java b/src/org/openstreetmap/josm/data/validation/ValidatorCLI.java
--- a/src/org/openstreetmap/josm/data/validation/ValidatorCLI.java	(revision 18861)
+++ b/src/org/openstreetmap/josm/data/validation/ValidatorCLI.java	(date 1696419256897)
@@ -355,7 +355,9 @@
         Config.setUrlsProvider(JosmUrls.getInstance());
         ProjectionRegistry.setProjection(Projections.getProjectionByCode("epsg:3857".toUpperCase(Locale.ROOT)));
 
-        Territories.initializeInternalData();
+        if (Territories.getKnownIso3166Codes().isEmpty()) {
+            Territories.initializeInternalData();
+        }
         OsmValidator.initialize();
         MapPaintStyles.readFromPreferences();
     }
Index: src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java
--- a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java	(revision 18861)
+++ b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java	(date 1696419256909)
@@ -41,7 +41,7 @@
 public final class TaggingPresets {
 
     /** The collection of tagging presets */
-    private static final Collection<TaggingPreset> taggingPresets = new ArrayList<>();
+    private static final List<TaggingPreset> TAGGING_PRESETS = new ArrayList<>();
 
     /** cache for key/value pairs found in the preset */
     private static final MultiMap<String, String> PRESET_TAG_CACHE = new MultiMap<>();
@@ -68,9 +68,9 @@
      * Initializes tagging presets from preferences.
      */
     public static void readFromPreferences() {
-        taggingPresets.clear();
-        taggingPresets.addAll(TaggingPresetReader.readFromPreferences(false, false));
-        cachePresets(taggingPresets);
+        TAGGING_PRESETS.clear();
+        TAGGING_PRESETS.addAll(TaggingPresetReader.readFromPreferences(false, false));
+        cachePresets(TAGGING_PRESETS);
     }
 
     /**
@@ -88,19 +88,19 @@
         }
 
         readFromPreferences();
-        final List<TaggingPreset> activeLayerChangeListeners = new ArrayList<>(taggingPresets.size());
-        for (TaggingPreset tp: taggingPresets) {
+        final List<TaggingPreset> activeLayerChangeListeners = new ArrayList<>(TAGGING_PRESETS.size());
+        for (TaggingPreset tp: TAGGING_PRESETS) {
             if (!(tp instanceof TaggingPresetSeparator)) {
                 MainApplication.getToolbar().register(tp);
                 activeLayerChangeListeners.add(tp);
             }
         }
         MainApplication.getLayerManager().addActiveLayerChangeListeners(activeLayerChangeListeners);
-        if (taggingPresets.isEmpty()) {
+        if (TAGGING_PRESETS.isEmpty()) {
             presetsMenu.setVisible(false);
         } else {
             Map<TaggingPresetMenu, JMenu> submenus = new HashMap<>();
-            for (final TaggingPreset p : taggingPresets) {
+            for (final TaggingPreset p : TAGGING_PRESETS) {
                 JMenu m = p.group != null ? submenus.get(p.group) : presetsMenu;
                 if (m == null && p.group != null) {
                     Logging.error("No tagging preset submenu for " + p.group);
@@ -126,7 +126,7 @@
                 }
             }
         }
-        if (SORT_MENU.get()) {
+        if (Boolean.TRUE.equals(SORT_MENU.get())) {
             TaggingPresetMenu.sortMenu(presetsMenu);
         }
         listeners.forEach(TaggingPresetListener::taggingPresetsModified);
@@ -141,13 +141,13 @@
      */
     public static void destroy() {
         ToolbarPreferences toolBar = MainApplication.getToolbar();
-        for (TaggingPreset tp: taggingPresets) {
+        for (TaggingPreset tp: TAGGING_PRESETS) {
             toolBar.unregister(tp);
             if (!(tp instanceof TaggingPresetSeparator)) {
                 MainApplication.getLayerManager().removeActiveLayerChangeListener(tp);
             }
         }
-        taggingPresets.clear();
+        TAGGING_PRESETS.clear();
         PRESET_TAG_CACHE.clear();
         PRESET_ROLE_CACHE.clear();
         MainApplication.getMenu().presetsMenu.removeAll();
@@ -190,7 +190,7 @@
      * @return a new collection containing all tagging presets. Empty if presets are not initialized (never null)
      */
     public static Collection<TaggingPreset> getTaggingPresets() {
-        return Collections.unmodifiableCollection(taggingPresets);
+        return Collections.unmodifiableList(TAGGING_PRESETS);
     }
 
     /**
@@ -263,7 +263,7 @@
      * @param presets The tagging presets to add
      */
     public static void addTaggingPresets(Collection<TaggingPreset> presets) {
-        if (presets != null && taggingPresets.addAll(presets)) {
+        if (presets != null && TAGGING_PRESETS.addAll(presets)) {
             listeners.forEach(TaggingPresetListener::taggingPresetsModified);
         }
     }
Index: test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java b/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java
--- a/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java	(revision 18861)
+++ b/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java	(date 1696419256913)
@@ -6,29 +6,22 @@
 import java.net.URL;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.tools.HttpClient;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Automatic test of imagery synchronization between JOSM and ELI.
  * See <a href="https://josm.openstreetmap.de/wiki/ImageryCompare">JOSM wiki</a>
  */
+@BasicPreferences
+@Timeout(60)
 class ImageryCompareTestIT {
 
     private static final String BLACK_PREFIX = "<pre style=\"margin:3px;color:black\">";
     private static final String RED_PREFIX = "<pre style=\"margin:3px;color:red\">";
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().timeout(60000);
-
     /**
      * Test of imagery entries.
      * @throws Exception if an error occurs
Index: test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java b/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java
--- a/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java	(revision 18861)
+++ b/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java	(date 1696419256914)
@@ -9,44 +9,34 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import jakarta.json.Json;
-import jakarta.json.JsonObject;
-import jakarta.json.JsonReader;
-import jakarta.json.JsonValue;
-
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;
 import org.openstreetmap.josm.data.validation.tests.TagChecker;
 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.tools.HttpClient;
-import org.xml.sax.SAXException;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import jakarta.json.Json;
+import jakarta.json.JsonObject;
+import jakarta.json.JsonReader;
+import jakarta.json.JsonValue;
 
 /**
  * Various integration tests with Taginfo.
  */
+@BasicPreferences
+@Timeout(20)
 class TaginfoTestIT {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20000);
-
     /**
      * Checks that popular tags are known (i.e included in internal presets, or deprecated, or explicitely ignored)
-     * @throws SAXException if any XML parsing error occurs
      * @throws IOException if any I/O error occurs
      * @throws ParseException if any MapCSS parsing error occurs
      */
     @Test
-    void testCheckPopularTags() throws SAXException, IOException, ParseException {
+    void testCheckPopularTags() throws IOException, ParseException {
         TaggingPresets.readFromPreferences();
         new TagChecker().initialize();
         MapCSSTagChecker mapCssTagChecker = new MapCSSTagChecker();
Index: test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java b/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java
--- a/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java	(revision 18861)
+++ b/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java	(date 1696419256912)
@@ -11,18 +11,16 @@
 import java.util.stream.Collectors;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.search.SearchCompiler;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Test of boundaries OSM file.
  */
+@BasicPreferences
 class BoundariesTestIT {
 
     private static final List<String> RETIRED_ISO3166_1_CODES = Arrays.asList(
@@ -46,13 +44,6 @@
             "US-PR", "US-RI", "US-SC", "US-SD", "US-TN", "US-TX", "US-UM", "US-UT", "US-VT", "US-VA", "US-VI", "US-WA", "US-WV", "US-WI",
             "US-WY");
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
-
     /**
      * Test of boundaries OSM file.
      * @throws Exception if an error occurs
Index: test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java b/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
--- a/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java	(revision 18861)
+++ b/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java	(date 1696857947862)
@@ -27,7 +27,6 @@
 
 import javax.imageio.ImageIO;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
 import org.openstreetmap.josm.TestUtils;
@@ -39,18 +38,19 @@
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.Utils;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Test cases for {@link StyledMapRenderer} and the MapCSS classes.
  * <p>
  * This test uses the data and reference files stored in the test data directory {@value #TEST_DATA_BASE}
  * @author Michael Zangl
  */
+@BasicPreferences
+@Projection
 public class MapCSSRendererTest {
     private static final String TEST_DATA_BASE = "/renderer/";
     /**
@@ -59,13 +59,6 @@
     private static final Bounds AREA_DEFAULT = new Bounds(0, 0, 1, 1);
     private static final int IMAGE_SIZE = 256;
 
-    /**
-     * Minimal test rules required
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
-
     // development flag - set to true in order to update all reference images
     private static final boolean UPDATE_ALL = false;
 
Index: test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java b/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java
--- a/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java	(revision 18861)
+++ b/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java	(date 1696440043861)
@@ -9,13 +9,15 @@
 import java.awt.Graphics2D;
 import java.awt.image.BufferedImage;
 import java.io.File;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.IdentityHashMap;
 
 import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -26,15 +28,21 @@
 import org.openstreetmap.josm.gui.NavigatableComponent;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.Compression;
+import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.Pair;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Test {@link StyleCache}.
  */
+@BasicPreferences
+@Main
+@org.openstreetmap.josm.testutils.annotations.MapPaintStyles
+@Projection
+@Timeout(60)
 class StyleCacheTest {
 
     private static final int IMG_WIDTH = 1400;
@@ -46,12 +54,13 @@
     private static DataSet dsCity;
     private static DataSet dsCity2;
 
-    /**
-     * The test rules used for this test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().preferences().projection().mapStyles().timeout(60000);
+    @BeforeAll
+    static void beforeAll() throws IllegalDataException, IOException {
+        try (InputStream in = Compression.getUncompressedFileInputStream(new File("nodist/data/neubrandenburg.osm.bz2"))) {
+            dsCity = OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE);
+        }
+        dsCity2 = new DataSet(dsCity);
+    }
 
     /**
      * Load the test data that is required.
@@ -60,10 +69,6 @@
     @BeforeEach
     public void load() throws Exception {
         img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_ARGB);
-        try (InputStream in = Compression.getUncompressedFileInputStream(new File("nodist/data/neubrandenburg.osm.bz2"))) {
-            dsCity = OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE);
-        }
-        dsCity2 = new DataSet(dsCity);
     }
 
     /**
@@ -96,11 +101,11 @@
     /**
      * Verifies, that the intern pool is not growing when repeatedly rendering the
      * same set of primitives (and clearing the calculated styles each time).
-     *
+     * <p>
      * If it grows, this is an indication that the {@code equals} and {@code hashCode}
      * implementation is broken and two identical objects are not recognized as equal
      * or produce different hash codes.
-     *
+     * <p>
      * The opposite problem (different objects are mistaken as equal) has more visible
      * consequences for the user (wrong rendering on the map) and is not recognized by
      * this test.
@@ -134,7 +139,7 @@
     /**
      * Verifies, that the number of {@code StyleElementList} instances stored
      * for all the rendered primitives is actually low (as intended).
-     *
+     * <p>
      * Two primitives with the same style should share one {@code StyleElementList}
      * instance for the cached style elements. This is verified by counting all
      * the instances using {@code A == B} identity.
Index: test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java
--- a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java	(revision 18861)
+++ b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java	(date 1696419256920)
@@ -16,7 +16,6 @@
 
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
-import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.PerformanceTestUtils;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -24,12 +23,16 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.Compression;
 import org.openstreetmap.josm.io.OsmReader;
+import org.openstreetmap.josm.testutils.annotations.Projection;
+import org.openstreetmap.josm.testutils.annotations.Territories;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
  * Abstract superclass of {@code StyledMapRendererPerformanceTest} and {@code WireframeMapRendererPerformanceTest}.
  */
+@Projection
+@Territories
 @Timeout(value = 15, unit = TimeUnit.MINUTES)
 abstract class AbstractMapRendererPerformanceTestParent {
 
@@ -48,7 +51,6 @@
     private static DataSet dsCity;
 
     protected static void load() throws Exception {
-        JOSMFixture.createPerformanceTestFixture().init(true);
         img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_ARGB);
         g = (Graphics2D) img.getGraphics();
         g.setClip(0, 0, IMG_WIDTH, IMG_HEIGHT);
Index: test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java b/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java
--- a/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java	(revision 18861)
+++ b/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java	(date 1696419256919)
@@ -16,11 +16,10 @@
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.PerformanceTestUtils;
 import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer;
 import org.openstreetmap.josm.data.osm.OsmDataGenerator.KeyValueDataGenerator;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
@@ -28,6 +27,7 @@
  * This test measures the performance of {@link OsmPrimitive#get(String)} and related.
  * @author Michael Zangl
  */
+@Projection
 @Timeout(value = 15, unit = TimeUnit.MINUTES)
 class KeyValuePerformanceTest {
     private static final int PUT_RUNS = 10000;
@@ -38,13 +38,6 @@
     private final ArrayList<String> testStrings = new ArrayList<>();
     private Random random;
 
-    /**
-     * Prepare the test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * See if there is a big difference between Strings that are interned and those that are not.
      */
Index: test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java
--- a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java	(revision 18861)
+++ b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSPerformanceTest.java	(date 1696419256922)
@@ -10,8 +10,6 @@
 import java.util.Collection;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.BeforeAll;
-import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.PerformanceTestUtils;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -21,12 +19,14 @@
 import org.openstreetmap.josm.gui.NavigatableComponent;
 import org.openstreetmap.josm.gui.mappaint.MapRendererPerformanceTest;
 import org.openstreetmap.josm.io.IllegalDataException;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * This performance test measures the time for a full run of MapPaintVisitor.visitAll()
  * against a test data set using a test style.
  *
  */
+@Projection
 class MapCSSPerformanceTest {
 
     /* ------------------------ configuration section  ---------------------------- */
@@ -47,14 +47,6 @@
           }
     }
 
-    /**
-     * Setup test.
-     */
-    @BeforeAll
-    public static void createJOSMFixture() {
-        JOSMFixture.createPerformanceTestFixture().init(true);
-    }
-
     long timed(Runnable callable) {
         long before = System.currentTimeMillis();
         callable.run();
Index: test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java
--- a/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java	(revision 18861)
+++ b/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java	(date 1696885623286)
@@ -3,20 +3,20 @@
 
 import java.util.concurrent.TimeUnit;
 
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
-import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.PerformanceTestUtils;
 import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer;
 import org.openstreetmap.josm.data.osm.OsmDataGenerator;
 import org.openstreetmap.josm.data.osm.OsmDataGenerator.KeyValueDataGenerator;
 import org.openstreetmap.josm.gui.mappaint.MultiCascade;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Tests how fast {@link MapCSSStyleSource} finds the right style candidates for one object.
  * @author Michael Zangl
  */
+@Projection
 @Timeout(value = 15, unit = TimeUnit.MINUTES)
 class MapCSSStyleSourceFilterTest {
 
@@ -80,14 +80,6 @@
 
     private static final int APPLY_CALLS = 100000;
 
-    /**
-     * Prepare the test.
-     */
-    @BeforeAll
-    public static void createJOSMFixture() {
-        JOSMFixture.createPerformanceTestFixture().init(true);
-    }
-
     /**
      * Time how long it takes to evaluate [key=value] rules
      */
Index: test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java
--- a/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java	(revision 18861)
+++ b/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java	(date 1696419256921)
@@ -18,6 +18,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import javax.imageio.ImageIO;
@@ -25,8 +26,7 @@
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.openstreetmap.josm.JOSMFixture;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.PerformanceTestUtils;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
@@ -43,13 +43,21 @@
 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector;
 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
+import org.openstreetmap.josm.testutils.annotations.Territories;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
  * Performance test of map renderer.
  */
+@BasicPreferences
+@Main
+@Projection
+@Territories
+@Timeout(value = 15, unit = TimeUnit.MINUTES)
 public class MapRendererPerformanceTest {
 
     private static final boolean DUMP_IMAGE = false; // dump images to file for debugging purpose
@@ -80,21 +88,12 @@
 
     private static final EnumMap<Feature, BooleanStyleSetting> filters = new EnumMap<>(Feature.class);
 
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().preferences().timeout(15 * 60 * 1000);
-
     /**
      * Initializes test environment.
      * @throws Exception if any error occurs
      */
     @BeforeAll
     public static void load() throws Exception {
-        JOSMFixture.createPerformanceTestFixture().init(true);
-
         img = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_ARGB);
         g = (Graphics2D) img.getGraphics();
         g.setClip(0, 0, IMG_WIDTH, IMG_HEIGHT);
Index: test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java	(date 1696419256950)
@@ -4,29 +4,21 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.NoteData;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link AddNoteAction}.
  */
+@Main
+@Projection
 class AddNoteActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link AddNoteAction#enterMode} and {@link AddNoteAction#exitMode}.
      */
Index: test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java	(date 1696419256951)
@@ -4,7 +4,6 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.mapmode.DeleteAction.DeleteMode;
@@ -12,22 +11,15 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link DeleteAction}.
  */
+@Main
+@Projection
 class DeleteActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link DeleteAction#enterMode} and {@link DeleteAction#exitMode}.
      */
Index: test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(date 1696419256952)
@@ -13,8 +13,8 @@
 
 import javax.swing.JList;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.data.UndoRedoHandler;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -25,32 +25,24 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.PrimitiveRenderer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link DrawAction}.
  */
+@Main
+@Projection
+@Timeout(20)
 class DrawActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection().timeout(20000);
-
     /**
      * Non regression test case for bug #12011.
      * Add a new node in the middle of way then undo. The rendering of the node, selected, must not cause any crash in PrimitiveRenderer.
      * @throws SecurityException see {@link Class#getDeclaredField} for details
-     * @throws NoSuchFieldException see {@link Class#getDeclaredField} for details
-     * @throws IllegalAccessException see {@link Field#set} for details
      * @throws IllegalArgumentException see {@link Field#set} for details
      */
     @Test
-    void testTicket12011() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
+    void testTicket12011() throws IllegalArgumentException, SecurityException {
         DataSet dataSet = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
         MainApplication.getLayerManager().addLayer(layer);
@@ -66,7 +58,7 @@
         dataSet.addPrimitive(n2);
 
         Way w = new Way();
-        w.setNodes(Arrays.asList(new Node[] {n1, n2}));
+        w.setNodes(Arrays.asList(n1, n2));
         dataSet.addPrimitive(w);
 
         try {
Index: test/unit/org/openstreetmap/josm/actions/mapmode/DrawSnapHelperTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/DrawSnapHelperTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/DrawSnapHelperTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/DrawSnapHelperTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/DrawSnapHelperTest.java	(date 1696419256953)
@@ -10,7 +10,6 @@
 
 import javax.swing.JCheckBoxMenuItem;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
@@ -25,16 +24,15 @@
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
 import org.openstreetmap.josm.tools.Utils;
 
 /**
  * Test class for {@link DrawSnapHelper}
  */
+@Main
+@org.openstreetmap.josm.testutils.annotations.Projection
 class DrawSnapHelperTest {
-    @RegisterExtension
-    static JOSMTestRules rule = new JOSMTestRules().projection().main();
-
     static Stream<Arguments> testNonRegression13097() {
         return Stream.of(
                 Arguments.of(Projections.getProjectionByCode("EPSG:4326")), // WGS84 Geographic
Index: test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java	(date 1696419256954)
@@ -4,7 +4,6 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.mapmode.ExtrudeAction.Mode;
@@ -12,22 +11,15 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link ExtrudeAction}.
  */
+@Main
+@Projection
 class ExtrudeActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link ExtrudeAction#enterMode} and {@link ExtrudeAction#exitMode}.
      */
Index: test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java	(date 1696419256955)
@@ -4,7 +4,6 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.mapmode.ImproveWayAccuracyAction.State;
@@ -12,22 +11,15 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link ImproveWayAccuracyAction}.
  */
+@Main
+@Projection
 class ImproveWayAccuracyActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link ImproveWayAccuracyAction#enterMode} and {@link ImproveWayAccuracyAction#exitMode}.
      */
Index: test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java	(date 1696419256956)
@@ -4,7 +4,6 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.mapmode.ParallelWayAction.Mode;
@@ -13,22 +12,15 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link ParallelWayAction}.
  */
+@Main
+@Projection
 class ParallelWayActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link ParallelWayAction#enterMode} and {@link ParallelWayAction#exitMode}.
      */
Index: test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java	(date 1696419256957)
@@ -4,29 +4,21 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link PlayHeadDragMode}.
  */
+@Main
+@Projection
 class PlayHeadDragModeTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link PlayHeadDragMode#enterMode} and {@link PlayHeadDragMode#exitMode}.
      */
Index: test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java b/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java	(date 1696419256958)
@@ -12,7 +12,6 @@
 import java.util.Collection;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.mapmode.SelectAction.Mode;
 import org.openstreetmap.josm.actions.mapmode.SelectAction.SelectActionCursor;
@@ -25,7 +24,8 @@
 import org.openstreetmap.josm.gui.layer.MainLayerManager;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.ReflectionUtils;
 
@@ -34,6 +34,8 @@
 /**
  * Unit tests for class {@link SelectAction}.
  */
+@Main
+@Projection
 class SelectActionTest {
 
     boolean nodesMerged;
@@ -54,13 +56,6 @@
         }
     }
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().main();
-
     /**
      * Test case: Move a two nodes way near a third node.
      * Resulting way should be attach to the third node.
Index: test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java b/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java
--- a/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java	(date 1696419256959)
@@ -11,7 +11,6 @@
 import java.util.Collection;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.command.PseudoCommand;
 import org.openstreetmap.josm.command.SequenceCommand;
 import org.openstreetmap.josm.data.APIDataSet;
@@ -20,22 +19,13 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests for class {@link FixDataHook}.
  */
+@Main
 class FixDataHookTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Test of {@link FixDataHook#checkUpload} method.
      */
Index: test/unit/org/openstreetmap/josm/actions/upload/UploadNotesTaskTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/upload/UploadNotesTaskTest.java b/test/unit/org/openstreetmap/josm/actions/upload/UploadNotesTaskTest.java
--- a/test/unit/org/openstreetmap/josm/actions/upload/UploadNotesTaskTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/upload/UploadNotesTaskTest.java	(date 1696420393429)
@@ -14,7 +14,6 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
@@ -30,8 +29,8 @@
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.testutils.FakeOsmApi;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 import org.openstreetmap.josm.tools.Logging;
 
 import mockit.Mock;
@@ -42,10 +41,8 @@
  * @author Taylor Smock
  */
 @BasicPreferences
+@OsmApi(OsmApi.APIType.FAKE)
 class UploadNotesTaskTest {
-    @RegisterExtension
-    static JOSMTestRules josmTestRules = new JOSMTestRules().fakeAPI();
-
     static Stream<Arguments> testUpload() {
         final NoteData commonData = new NoteData();
         for (int i = 0; i < 12; i++) {
Index: test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java b/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java
--- a/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java	(date 1696419256961)
@@ -7,10 +7,8 @@
 import java.util.Collections;
 import java.util.stream.Stream;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import mockit.Mock;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Timeout;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
@@ -26,21 +24,21 @@
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker;
 
+import mockit.Mock;
+
 /**
  * Unit tests for class {@link ValidateUploadHook}.
  */
+@Main
+@OsmApi(OsmApi.APIType.FAKE)
+@Projection
+@Timeout(30)
 class ValidateUploadHookTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection().fakeAPI().timeout(30000);
-
     /**
      * Test of {@link ValidateUploadHook#checkUpload} method.
      */
Index: test/unit/org/openstreetmap/josm/actions/AboutActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/AboutActionTest.java b/test/unit/org/openstreetmap/josm/actions/AboutActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/AboutActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/AboutActionTest.java	(date 1696419256923)
@@ -1,31 +1,22 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.actions;
 
-import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
  * Unit tests for class {@link AboutAction}.
  */
+@Main
 final class AboutActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Unit test of {@link AboutAction#buildAboutPanel}.
      */
     @Test
     void testBuildAboutPanel() {
-        assertNotNull(new AboutAction().buildAboutPanel());
+        assertDoesNotThrow(() -> new AboutAction().buildAboutPanel());
     }
 }
Index: test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java b/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(date 1696419256924)
@@ -10,33 +10,26 @@
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.gui.jmapviewer.FeatureAdapter;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.TMSLayer;
 import org.openstreetmap.josm.gui.layer.WMSLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.annotations.BasicWiremock;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 import com.github.tomakehurst.wiremock.WireMockServer;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests for class {@link AddImageryLayerAction}.
  */
-@BasicWiremock
 @BasicPreferences
+@BasicWiremock
+@OsmApi(OsmApi.APIType.FAKE)
+@Projection
 final class AddImageryLayerActionTest {
-    /**
-     * We need prefs for this. We need platform for actions and the OSM API for checking blacklist.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().fakeAPI().projection();
-
     /**
      * HTTP mock.
      */
Index: test/unit/org/openstreetmap/josm/actions/AlignInCircleActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/AlignInCircleActionTest.java b/test/unit/org/openstreetmap/josm/actions/AlignInCircleActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/AlignInCircleActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/AlignInCircleActionTest.java	(date 1696419256926)
@@ -17,7 +17,6 @@
 import java.util.stream.Collectors;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.AlignInCircleAction.InvalidSelection;
 import org.openstreetmap.josm.command.Command;
@@ -29,24 +28,14 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.opentest4j.AssertionFailedError;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests for class {@link AlignInLineAction}.
  */
+@Projection
 final class AlignInCircleActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
-
     /**
      * Test case: way with several nodes selected
      * @throws Exception if an error occurs
@@ -64,19 +53,17 @@
             }
         }
         assertNotNull(roundabout);
-        if (roundabout != null) {
-            ds.setSelected(roundabout);
-            Command c = AlignInCircleAction.buildCommand(ds);
-            c.executeCommand();
-            Way expected = (Way) ds2.getPrimitiveById(roundabout);
-            assertNotNull(expected);
-            assertEquals(expected, roundabout);
-            assertEquals(expected.getNodesCount(), roundabout.getNodesCount());
-            for (Node n1 : roundabout.getNodes()) {
-                Node n2 = (Node) ds2.getPrimitiveById(n1);
-                assertEquals(n1.lat(), n2.lat(), 1e-5);
-                assertEquals(n1.lon(), n2.lon(), 1e-5);
-            }
+        ds.setSelected(roundabout);
+        Command c = AlignInCircleAction.buildCommand(ds);
+        c.executeCommand();
+        Way expected = (Way) ds2.getPrimitiveById(roundabout);
+        assertNotNull(expected);
+        assertEquals(expected, roundabout);
+        assertEquals(expected.getNodesCount(), roundabout.getNodesCount());
+        for (Node n1 : roundabout.getNodes()) {
+            Node n2 = (Node) ds2.getPrimitiveById(n1);
+            assertEquals(n1.lat(), n2.lat(), 1e-5);
+            assertEquals(n1.lon(), n2.lon(), 1e-5);
         }
     }
 
@@ -97,10 +84,8 @@
             }
         }
         assertNotNull(roundabout);
-        if (roundabout != null) {
-            ds.setSelected(roundabout);
-            assertNull(AlignInCircleAction.buildCommand(ds));
-        }
+        ds.setSelected(roundabout);
+        assertNull(AlignInCircleAction.buildCommand(ds));
     }
 
     /**
@@ -120,20 +105,18 @@
             }
         }
         assertNotNull(circularWay);
-        if (circularWay != null) {
-            ds.setSelected(circularWay.getNodes());
-            Command c = AlignInCircleAction.buildCommand(ds);
-            assertNotNull(c);
-            c.executeCommand();
-            Way expected = (Way) ds2.getPrimitiveById(circularWay);
-            assertNotNull(expected);
-            assertEquals(expected, circularWay);
-            assertEquals(expected.getNodesCount(), circularWay.getNodesCount());
-            for (Node n1 : circularWay.getNodes()) {
-                Node n2 = (Node) ds2.getPrimitiveById(n1);
-                assertEquals(n1.lat(), n2.lat(), 1e-5);
-                assertEquals(n1.lon(), n2.lon(), 1e-5);
-            }
+        ds.setSelected(circularWay.getNodes());
+        Command c = AlignInCircleAction.buildCommand(ds);
+        assertNotNull(c);
+        c.executeCommand();
+        Way expected = (Way) ds2.getPrimitiveById(circularWay);
+        assertNotNull(expected);
+        assertEquals(expected, circularWay);
+        assertEquals(expected.getNodesCount(), circularWay.getNodesCount());
+        for (Node n1 : circularWay.getNodes()) {
+            Node n2 = (Node) ds2.getPrimitiveById(n1);
+            assertEquals(n1.lat(), n2.lat(), 1e-5);
+            assertEquals(n1.lon(), n2.lon(), 1e-5);
         }
     }
 
Index: test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java b/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java	(date 1696419256927)
@@ -1,14 +1,13 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.actions;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.actions.AlignInLineAction.InvalidSelection;
 import org.openstreetmap.josm.actions.AlignInLineAction.Line;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -17,22 +16,15 @@
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link AlignInLineAction}.
  */
+@Main
+@Projection
 final class AlignInLineActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /** Class under test. */
     private static AlignInLineAction action;
 
@@ -49,8 +41,8 @@
     /**
      * Test case: only nodes selected, part of an open way: align these nodes on the line passing through the extremity
      * nodes (the most distant in the way sequence, not the most euclidean-distant). See
-     * https://josm.openstreetmap.de/ticket/9605#comment:3. Note that in this test, after alignment, way is overlapping
-     * itself.
+     * <a href="https://josm.openstreetmap.de/ticket/9605#comment:3">comment:3:ticket:9605</a>.
+     * Note that in this test, after alignment, way is overlapping itself.
      * @throws InvalidSelection never
      */
     @Test
@@ -210,11 +202,11 @@
      */
     @Test
     void testLineDifferentCoordinates() throws InvalidSelection {
-        assertNotNull(new Line(new Node(new EastNorth(0, 1)),
+        assertDoesNotThrow(() -> new Line(new Node(new EastNorth(0, 1)),
                                new Node(new EastNorth(0, 2))));
-        assertNotNull(new Line(new Node(new EastNorth(0, 1)),
+        assertDoesNotThrow(() -> new Line(new Node(new EastNorth(0, 1)),
                                new Node(new EastNorth(1, 1))));
-        assertNotNull(new Line(new Node(new EastNorth(0, 1)),
+        assertDoesNotThrow(() -> new Line(new Node(new EastNorth(0, 1)),
                                new Node(new EastNorth(0+1e-150, 1+1e-150))));
     }
 
Index: test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java b/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java	(date 1696438622004)
@@ -22,6 +22,7 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
+import org.openstreetmap.josm.testutils.annotations.ResetUniquePrimitiveIdCounters;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
 
@@ -113,6 +114,7 @@
      * @throws IllegalDataException if OSM parsing fails
      */
     @Test
+    @ResetUniquePrimitiveIdCounters
     void testTicket18367NeedsSplit() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18367, "split-and-reverse.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
Index: test/unit/org/openstreetmap/josm/actions/CopyActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java b/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java	(date 1696419256928)
@@ -16,7 +16,6 @@
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
@@ -25,13 +24,18 @@
 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
 import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link CopyAction}.
  */
+@BasicPreferences
+@Main
+@OsmApi(OsmApi.APIType.FAKE)
+@Projection
 class CopyActionTest {
     private static final class CapturingCopyAction extends CopyAction {
         private boolean warningShown;
@@ -42,13 +46,6 @@
         }
     }
 
-    /**
-     * We need prefs for this.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public static JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI().main().projection();
-
     /**
      * Test that copy action copies the selected primitive
      * @throws IOException if an I/O error occurs
Index: test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java b/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(date 1696419256929)
@@ -9,42 +9,31 @@
 import java.util.Collection;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.GeoProperty;
 import org.openstreetmap.josm.tools.GeoPropertyIndex;
 import org.openstreetmap.josm.tools.Geometry;
 import org.openstreetmap.josm.tools.ReflectionUtils;
 import org.openstreetmap.josm.tools.RightAndLefthandTraffic;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests for class {@link CreateCircleAction}.
  */
+@Projection
 final class CreateCircleActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Test case: When Create Circle action is performed with a single way selected,
      * circle direction must equals way direction.
      * see #7421
-     * @throws ReflectiveOperationException if an error occurs
      */
     @Test
-    void testTicket7421case0() throws ReflectiveOperationException {
+    void testTicket7421case0() {
         DataSet dataSet = new DataSet();
 
         Node n1 = new Node(new EastNorth(0, 0));
Index: test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java b/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java	(date 1696419256930)
@@ -14,7 +14,6 @@
 import java.util.TreeMap;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.SequenceCommand;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -29,24 +28,21 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.SubclassFilteredCollection;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit test of {@link CreateMultipolygonAction}
  */
+@BasicPreferences
+@Main
+@MapPaintStyles
+@Projection
 class CreateMultipolygonActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().main().preferences().mapStyles();
-
     private static Map<String, String> getRefToRoleMap(Relation relation) {
         Map<String, String> refToRole = new TreeMap<>();
         String ref = relation.get("ref");
Index: test/unit/org/openstreetmap/josm/actions/ExitActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java b/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java	(date 1696419256931)
@@ -8,19 +8,16 @@
 
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.cache.JCSCacheManager;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.io.SaveLayersDialog;
 import org.openstreetmap.josm.gui.progress.swing.ProgressMonitorExecutor;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Utils;
 
 import com.ginsberg.junit.exit.ExpectSystemExitWithStatus;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import mockit.Invocation;
 import mockit.Mock;
 import mockit.MockUp;
@@ -28,15 +25,8 @@
 /**
  * Unit tests for class {@link ExitAction}.
  */
+@Main
 final class ExitActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     @BeforeAll
     static void beforeAll() {
         assumeTrue(Utils.getJavaVersion() < 18 || "allow".equals(System.getProperty("java.security.manager")));
Index: test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java b/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java	(date 1696419256932)
@@ -1,23 +1,14 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.actions;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Test {@link FullscreenToggleAction}
  */
+@Main
 class FullscreenToggleActionTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Test {@link FullscreenToggleAction}
      */
Index: test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java b/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java	(date 1696419256933)
@@ -16,7 +16,6 @@
 import java.util.Set;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.search.SearchAction;
 import org.openstreetmap.josm.data.Bounds;
@@ -35,24 +34,19 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.MultiMap;
 import org.openstreetmap.josm.tools.Utils;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link JoinAreasAction} class.
  */
+@BasicPreferences
+@Main
+@Projection
 class JoinAreasActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection().preferences();
-
     /**
      * Non-regression test for bug #9599.
      * @throws IOException if any I/O error occurs
Index: test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java b/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java	(date 1696419256934)
@@ -12,7 +12,6 @@
 import java.util.stream.Collectors;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -26,22 +25,18 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.Geometry;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests for class {@link JoinNodeWayAction}.
  */
+@BasicPreferences
+@Main
+@Projection
 final class JoinNodeWayActionTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().main().preferences();
-
     private void setupMapView(DataSet ds) {
         // setup a reasonable size for the edit window
         MainApplication.getMap().mapView.setBounds(new Rectangle(1345, 939));
@@ -59,10 +54,9 @@
     /**
      * Test case: Move node onto two almost overlapping ways
      * see #18189 moveontoway.osm
-     * @throws Exception if an error occurs
      */
     @Test
-    void testTicket18189() throws Exception {
+    void testTicket18189() {
         DataSet dataSet = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
         MainApplication.getLayerManager().addLayer(layer);
Index: test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java b/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java	(date 1696419256936)
@@ -11,7 +11,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.ExtendedDialog;
@@ -19,24 +18,17 @@
 import org.openstreetmap.josm.gui.layer.LayerManagerTest.TestLayer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.widgets.JosmComboBox;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker;
 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests for class {@link MergeLayerAction}.
  */
+@Main
+@Projection
 public class MergeLayerActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * MergeLayerExtendedDialog mocker.
      */
Index: test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java b/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java	(date 1696419256937)
@@ -7,35 +7,27 @@
 
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link MergeNodesAction}.
  */
+@Projection
 class MergeNodesActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Unit test of {@link MergeNodesAction#selectTargetLocationNode} - empty list
      */
     @Test
     void testSelectTargetLocationNodeEmpty() {
-        assertThrows(IllegalArgumentException.class, () -> MergeNodesAction.selectTargetLocationNode(Collections.emptyList()));
+        final List<Node> noNodes = Collections.emptyList();
+        assertThrows(IllegalArgumentException.class, () -> MergeNodesAction.selectTargetLocationNode(noNodes));
     }
 
     /**
@@ -44,7 +36,8 @@
     @Test
     void testSelectTargetLocationNodeInvalidMode() {
         Config.getPref().putInt("merge-nodes.mode", -1);
-        assertThrows(IllegalStateException.class, () -> MergeNodesAction.selectTargetLocationNode(Arrays.asList(new Node(0), new Node(1))));
+        final List<Node> nodes = Arrays.asList(new Node(0), new Node(1));
+        assertThrows(IllegalStateException.class, () -> MergeNodesAction.selectTargetLocationNode(nodes));
     }
 
     /**
@@ -61,7 +54,7 @@
 
         Config.getPref().putInt("merge-nodes.mode", 2);
         assertEquals(LatLon.NORTH_POLE, MergeNodesAction.selectTargetLocationNode(
-                Arrays.asList(new Node(LatLon.NORTH_POLE))).getCoor());
+                Collections.singletonList(new Node(LatLon.NORTH_POLE))).getCoor());
     }
 
     /**
@@ -73,6 +66,6 @@
         DataSet ds = new DataSet();
         Node n1 = new Node(1);
         ds.addPrimitive(n1);
-        assertEquals(1, MergeNodesAction.selectTargetNode(Arrays.asList(n1)).getId());
+        assertEquals(1, MergeNodesAction.selectTargetNode(Collections.singletonList(n1)).getId());
     }
 }
Index: test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java b/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java	(date 1696419256938)
@@ -11,7 +11,6 @@
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.OrthogonalizeAction.Direction;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -22,27 +21,19 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.Geometry;
 import org.openstreetmap.josm.tools.SubclassFilteredCollection;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import net.trajano.commons.testing.UtilityClassTestUtil;
 
 /**
  * Unit tests for class {@link OrthogonalizeAction}.
  */
+@Projection
 class OrthogonalizeActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     @Test
-    void testNoSelection() throws Exception {
+    void testNoSelection() {
         assertThrows(OrthogonalizeAction.InvalidUserInputException.class, () -> performTest("nothing selected"));
     }
 
Index: test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java b/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java	(date 1696419256939)
@@ -4,11 +4,9 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -17,30 +15,22 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link PurgeAction}.
  */
+@Main
+@Projection
 class PurgeActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public static JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Non-regression test for ticket #12038.
      * @throws IOException if any I/O error occurs
-     * @throws FileNotFoundException if the data file cannot be found
      * @throws IllegalDataException if OSM parsing fails
      */
     @Test
-    void testCopyStringWayRelation() throws FileNotFoundException, IOException, IllegalDataException {
+    void testCopyStringWayRelation() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(12038, "data.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
             OsmDataLayer layer = new OsmDataLayer(ds, null, null);
Index: test/unit/org/openstreetmap/josm/actions/RestorePropertyActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/RestorePropertyActionTest.java b/test/unit/org/openstreetmap/josm/actions/RestorePropertyActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/RestorePropertyActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/RestorePropertyActionTest.java	(date 1696419256940)
@@ -7,28 +7,18 @@
 import javax.swing.ListSelectionModel;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
 import org.openstreetmap.josm.data.UndoRedoHandler;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Unit tests of {@link RestorePropertyAction}
  */
+@BasicPreferences
 class RestorePropertyActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
-
     @Test
     void testTicket20965() {
         doTest20965(null, null);
Index: test/unit/org/openstreetmap/josm/actions/SelectAllActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/SelectAllActionTest.java b/test/unit/org/openstreetmap/josm/actions/SelectAllActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/SelectAllActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/SelectAllActionTest.java	(date 1696419256941)
@@ -3,26 +3,20 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link SelectAllAction}.
  */
+@BasicPreferences
+@Main
+@Projection
 final class SelectAllActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rules = new JOSMTestRules().preferences().projection().main();
-
     /**
      * Unit test of {@link SelectAllAction#actionPerformed} method.
      */
Index: test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java b/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java	(date 1696419256943)
@@ -6,7 +6,6 @@
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -17,23 +16,19 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import net.trajano.commons.testing.UtilityClassTestUtil;
 
 /**
  * Unit tests for class {@link SelectByInternalPointAction}.
  */
+@BasicPreferences
+@Main
+@Projection
 final class SelectByInternalPointActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rules = new JOSMTestRules().preferences().projection().main();
-
     /**
      * Tests that {@code SelectByInternalPointAction} satisfies utility class criteria.
      * @throws ReflectiveOperationException if an error occurs
Index: test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java b/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java	(date 1696419256944)
@@ -4,23 +4,13 @@
 import static org.junit.jupiter.api.Assertions.assertFalse;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests for class {@link SessionSaveAsAction}.
  */
+@Main
 class SessionSaveAsActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Unit test of {@link SessionSaveAsAction#actionPerformed}
      */
Index: test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java b/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java	(date 1696419256945)
@@ -17,7 +17,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.DeleteCommand;
 import org.openstreetmap.josm.command.SequenceCommand;
@@ -28,26 +27,20 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.Utils;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests for class {@link SimplifyWayAction}.
  */
+@Main
+@Projection
 final class SimplifyWayActionTest {
 
     /** Class under test. */
     private static SimplifyWayAction action;
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Setup test.
      */
Index: test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java b/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java	(date 1696419256946)
@@ -7,7 +7,6 @@
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -16,21 +15,13 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link SplitWayAction}.
  */
+@Projection
 final class SplitWayActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
     private final DataSet dataSet = new DataSet();
 
     private Node addNode(int east, int north) {
Index: test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java b/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java	(date 1696419256947)
@@ -6,32 +6,27 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link UnGlueAction}.
  */
+@BasicPreferences
+@Main
+@Projection
 final class UnGlueActionTest {
 
     /** Class under test. */
     private static UnGlueAction action;
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection().preferences();
-
     /**
      * Setup test.
      */
Index: test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java b/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java	(date 1696419256947)
@@ -6,20 +6,20 @@
 import java.util.Arrays;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link UnJoinNodeWayAction}.
  */
+@Main
+@Projection
 final class UnJoinNodeWayActionTest {
 
     /**
@@ -32,16 +32,9 @@
          */
         @Override
         public void notify(String msg, int messageType) {
-            return;
+            // Do nothing
         }
     }
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public static JOSMTestRules test = new JOSMTestRules().projection().main();
 
     /**
      * Test case: Ignore irrelevant nodes
@@ -64,7 +57,7 @@
         dataSet.addPrimitive(n4);
 
         Way w = new Way();
-        w.setNodes(Arrays.asList(new Node[] {n1, n2, n3}));
+        w.setNodes(Arrays.asList(n1, n2, n3));
         dataSet.addPrimitive(w);
 
         dataSet.addSelected(n2);
Index: test/unit/org/openstreetmap/josm/actions/UploadActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java b/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java
--- a/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java	(date 1696419256948)
@@ -3,14 +3,14 @@
 
 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
 
 import java.awt.GraphicsEnvironment;
 import java.util.Collections;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.AddPrimitivesCommand;
 import org.openstreetmap.josm.data.UserIdentityManager;
@@ -21,9 +21,9 @@
 import org.openstreetmap.josm.gui.io.UploadDialog;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.testutils.annotations.Territories;
 import org.openstreetmap.josm.testutils.mockers.WindowMocker;
@@ -39,6 +39,7 @@
  */
 @BasicPreferences
 @Main
+@OsmApi(OsmApi.APIType.FAKE)
 @Projection
 // Territories is needed due to test pollution. One of the listeners
 // that may get registered on SelectionEventManager requires
@@ -46,16 +47,11 @@
 // avoid the NPE.
 @Territories(Territories.Initialize.ALL)
 class UploadActionTest {
-    // Only needed for layer cleanup. And user identity cleanup. And ensuring that data isn't accidentally uploaded.
-    // Note that the setUp method can be replaced by the @Territories extension, when that is merged.
-    @RegisterExtension
-    static JOSMTestRules josmTestRules = new JOSMTestRules().fakeAPI();
-
     /**
      * Non-regression test for JOSM #21476.
      */
     @Test
-    void testNonRegression21476() {
+    void testNonRegression21476() throws ExecutionException, InterruptedException, TimeoutException {
         TestUtils.assumeWorkingJMockit();
         Logging.clearLastErrorAndWarnings();
         new WindowMocker();
@@ -83,8 +79,6 @@
                 // sync worker
             }).get(1, TimeUnit.SECONDS);
             assertTrue(Logging.getLastErrorAndWarnings().isEmpty());
-        } catch (Exception exception) {
-            fail(exception);
         } finally {
             Logging.clearLastErrorAndWarnings();
         }
@@ -108,7 +102,7 @@
         @Mock
         public final boolean isCanceled(final Invocation invocation) {
             if (!GraphicsEnvironment.isHeadless()) {
-                return invocation.proceed();
+                return Boolean.TRUE.equals(invocation.proceed());
             }
             return true;
         }
Index: test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java	(date 1696945430647)
@@ -9,6 +9,7 @@
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
@@ -16,6 +17,7 @@
 /**
  * Unit tests of {@link DeletedStateConflictResolveCommand} class.
  */
+@MapPaintStyles
 class DeletedStateConflictResolveCommandTest {
     /**
      * Unit test of methods {@link DeletedStateConflictResolveCommand#equals} and {@link DeletedStateConflictResolveCommand#hashCode}.
Index: test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java	(date 1696945559459)
@@ -9,6 +9,7 @@
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
@@ -16,6 +17,7 @@
 /**
  * Unit tests of {@link ModifiedConflictResolveCommand} class.
  */
+@MapPaintStyles
 class ModifiedConflictResolveCommandTest {
     /**
      * Unit test of methods {@link ModifiedConflictResolveCommand#equals} and {@link ModifiedConflictResolveCommand#hashCode}.
Index: test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java	(date 1696945596859)
@@ -9,6 +9,7 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
@@ -16,6 +17,7 @@
 /**
  * Unit tests of {@link RelationMemberConflictResolverCommand} class.
  */
+@MapPaintStyles
 class RelationMemberConflictResolverCommandTest {
     /**
      * Unit test of methods {@link RelationMemberConflictResolverCommand#equals} and {@link RelationMemberConflictResolverCommand#hashCode}.
Index: test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java	(date 1696945758553)
@@ -9,6 +9,7 @@
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
@@ -16,6 +17,7 @@
 /**
  * Unit tests of {@link TagConflictResolveCommand} class.
  */
+@MapPaintStyles
 class TagConflictResolveCommandTest {
     /**
      * Unit test of methods {@link TagConflictResolveCommand#equals} and {@link TagConflictResolveCommand#hashCode}.
Index: test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java	(date 1696945783998)
@@ -9,6 +9,7 @@
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
@@ -16,6 +17,7 @@
 /**
  * Unit tests of {@link VersionConflictResolveCommand} class.
  */
+@MapPaintStyles
 class VersionConflictResolveCommandTest {
     /**
      * Unit test of methods {@link VersionConflictResolveCommand#equals} and {@link VersionConflictResolveCommand#hashCode}.
Index: test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java	(date 1696945886273)
@@ -9,6 +9,7 @@
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
@@ -16,6 +17,7 @@
 /**
  * Unit tests of {@link WayNodesConflictResolverCommand} class.
  */
+@MapPaintStyles
 class WayNodesConflictResolverCommandTest {
     /**
      * Unit test of methods {@link WayNodesConflictResolverCommand#equals} and {@link WayNodesConflictResolverCommand#hashCode}.
Index: test/unit/org/openstreetmap/josm/command/MoveCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java b/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java	(date 1696419256962)
@@ -13,7 +13,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -24,22 +23,20 @@
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.I18n;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
 
 /**
  * Unit tests of {@link MoveCommand} class.
  */
+@BasicPreferences
+@I18n
+@Projection
 class MoveCommandTest {
-    /**
-     * We need prefs for nodes.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().i18n().projection();
     private CommandTestDataWithRelation testData;
 
     /**
@@ -59,7 +56,7 @@
         LatLon destLatLon = ProjectionRegistry.getProjection().eastNorth2latlon(offset);
         EastNorth start = new EastNorth(2, 0);
 
-        Set<OsmPrimitive> nodeAsCollection = Collections.<OsmPrimitive>singleton(testData.existingNode);
+        Set<OsmPrimitive> nodeAsCollection = Collections.singleton(testData.existingNode);
         assertEquals(1, nodeAsCollection.size());
         checkCommandAfterConstructor(new MoveCommand(nodeAsCollection, offset));
         checkCommandAfterConstructor(new MoveCommand(testData.existingNode, destLatLon));
@@ -220,7 +217,7 @@
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
         ArrayList<OsmPrimitive> added = new ArrayList<>();
-        new MoveCommand(Arrays.<OsmPrimitive>asList(testData.existingNode), 1, 2).fillModifiedData(modified,
+        new MoveCommand(Collections.singletonList(testData.existingNode), 1, 2).fillModifiedData(modified,
                 deleted, added);
         assertArrayEquals(new Object[] {testData.existingNode }, modified.toArray());
         assertArrayEquals(new Object[] {}, deleted.toArray());
@@ -232,12 +229,12 @@
      */
     @Test
     void testGetParticipatingPrimitives() {
-        MoveCommand command = new MoveCommand(Arrays.<OsmPrimitive>asList(testData.existingNode), 1, 2);
+        MoveCommand command = new MoveCommand(Collections.singletonList(testData.existingNode), 1, 2);
         command.executeCommand();
         assertArrayEquals(new Object[] {testData.existingNode}, command.getParticipatingPrimitives().toArray());
 
         MoveCommand command2 = new MoveCommand(
-                Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingWay), 1, 2);
+                Arrays.asList(testData.existingNode, testData.existingWay), 1, 2);
         command2.executeCommand();
         assertArrayEquals(new Object[] {testData.existingNode, testData.existingNode2},
                 command2.getParticipatingPrimitives().toArray());
@@ -250,9 +247,9 @@
     void testDescription() {
         Node node = TestUtils.addFakeDataSet(new Node(LatLon.ZERO));
         node.put("name", "xy");
-        List<OsmPrimitive> nodeList = Arrays.<OsmPrimitive>asList(node);
+        List<OsmPrimitive> nodeList = Collections.singletonList(node);
         assertTrue(new MoveCommand(nodeList, 1, 2).getDescriptionText().matches("Move 1 node"));
-        List<OsmPrimitive> nodes = Arrays.<OsmPrimitive>asList(node, testData.existingNode, testData.existingNode2);
+        List<OsmPrimitive> nodes = Arrays.asList(node, testData.existingNode, testData.existingNode2);
         assertTrue(new MoveCommand(nodes, 1, 2).getDescriptionText().matches("Move 3 nodes"));
     }
 
Index: test/unit/org/openstreetmap/josm/command/RotateCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java b/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java	(date 1696419256963)
@@ -6,10 +6,10 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.CommandTest.CommandTestData;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -19,23 +19,18 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
 
 /**
  * Unit tests of {@link RotateCommand} class.
  */
+@BasicPreferences
+@Projection
 class RotateCommandTest {
-
-    /**
-     * We need prefs for nodes.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
     private CommandTestData testData;
 
     /**
@@ -99,7 +94,7 @@
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
         ArrayList<OsmPrimitive> added = new ArrayList<>();
-        RotateCommand command = new RotateCommand(Arrays.asList(testData.existingNode),
+        RotateCommand command = new RotateCommand(Collections.singletonList(testData.existingNode),
                 new EastNorth(0, 0));
         // intentionally empty
         command.fillModifiedData(modified, deleted, added);
@@ -113,7 +108,7 @@
      */
     @Test
     void testGetParticipatingPrimitives() {
-        RotateCommand command = new RotateCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0));
+        RotateCommand command = new RotateCommand(Collections.singletonList(testData.existingNode), new EastNorth(0, 0));
         command.executeCommand();
         assertArrayEquals(new Object[] {testData.existingNode}, command.getParticipatingPrimitives().toArray());
     }
@@ -124,7 +119,7 @@
     @Test
     void testDescription() {
         assertEquals("Rotate 1 node",
-                new RotateCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0))
+                new RotateCommand(Collections.singletonList(testData.existingNode), new EastNorth(0, 0))
                         .getDescriptionText());
         assertEquals("Rotate 2 nodes",
                 new RotateCommand(Arrays.asList(testData.existingNode, testData.existingNode2), new EastNorth(0, 0))
Index: test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java b/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java	(date 1696419256965)
@@ -6,10 +6,10 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.CommandTest.CommandTestData;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -19,23 +19,18 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
 
 /**
  * Unit tests of {@link ScaleCommand} class.
  */
+@BasicPreferences
+@Projection
 class ScaleCommandTest {
-
-    /**
-     * We need prefs for nodes.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
     private CommandTestData testData;
 
     /**
@@ -99,7 +94,7 @@
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
         ArrayList<OsmPrimitive> added = new ArrayList<>();
-        ScaleCommand command = new ScaleCommand(Arrays.asList(testData.existingNode),
+        ScaleCommand command = new ScaleCommand(Collections.singletonList(testData.existingNode),
                 new EastNorth(0, 0));
         // intentionally empty
         command.fillModifiedData(modified, deleted, added);
@@ -113,7 +108,7 @@
      */
     @Test
     void testGetParticipatingPrimitives() {
-        ScaleCommand command = new ScaleCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0));
+        ScaleCommand command = new ScaleCommand(Collections.singletonList(testData.existingNode), new EastNorth(0, 0));
         command.executeCommand();
         assertArrayEquals(new Object[] {testData.existingNode }, command.getParticipatingPrimitives().toArray());
     }
@@ -124,7 +119,7 @@
     @Test
     void testDescription() {
         assertEquals("Scale 1 node",
-                new ScaleCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0))
+                new ScaleCommand(Collections.singletonList(testData.existingNode), new EastNorth(0, 0))
                         .getDescriptionText());
         assertEquals("Scale 2 nodes",
                 new ScaleCommand(Arrays.asList(testData.existingNode, testData.existingNode2), new EastNorth(0, 0))
Index: test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java b/test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java
--- a/test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java	(date 1696419256966)
@@ -17,7 +17,6 @@
 import java.util.stream.Stream;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
@@ -37,22 +36,17 @@
 import org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionTypeCalculator;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link SplitWayCommand}.
  */
+@BasicPreferences
+@Main
+@Projection
 final class SplitWayCommandTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    static JOSMTestRules test = new JOSMTestRules().main().projection().preferences();
-
     /**
      * Unit test of {@link SplitWayCommand#findVias}.
      */
@@ -302,7 +296,7 @@
 
     /**
      * Non-regression test for issue #17400 (Warn when splitting way in not fully downloaded region)
-     *
+     * <p>
      * Bus route 190 gets broken when the split occurs, because the two new way parts are inserted in the relation in
      * the wrong order.
      *
@@ -347,11 +341,11 @@
 
     /**
      * Non-regression test for issue #18863 (Asking for download of missing members when not needed)
-     *
+     * <p>
      * A split on node 4518025255 caused the 'download missing members?' dialog to pop up for relation 68745 (CB 2),
      * even though the way members next to the split way were already downloaded. This happened because this relation
      * does not have its members connected at all.
-     *
+     * <p>
      * This split should not trigger any download action at all.
      *
      * @throws IOException if any I/O error occurs
Index: test/unit/org/openstreetmap/josm/data/cache/HostLimitQueueTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/cache/HostLimitQueueTest.java b/test/unit/org/openstreetmap/josm/data/cache/HostLimitQueueTest.java
--- a/test/unit/org/openstreetmap/josm/data/cache/HostLimitQueueTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/cache/HostLimitQueueTest.java	(date 1696419256968)
@@ -12,26 +12,19 @@
 
 import org.apache.commons.jcs3.access.behavior.ICacheAccess;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.data.imagery.TMSCachedTileLoader;
 import org.openstreetmap.josm.data.imagery.TileJobOptions;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.tools.Logging;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
- * Simple tests for ThreadPoolExecutor / HostLimitQueue veryfing, that this pair works OK
+ * Simple tests for ThreadPoolExecutor / HostLimitQueue verifying, that this pair works OK
  * @author Wiktor Niesiobedzki
  */
+@BasicPreferences
+@Timeout(20)
 class HostLimitQueueTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20 * 1000);
-
     /**
      * Mock class for tests
      */
Index: test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java b/test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java
--- a/test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java	(date 1696419256972)
@@ -3,25 +3,16 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.ILatLon;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Test for {@link ICoordinateFormat} implementations.
  */
+@Projection
 class ICoordinateFormatTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Tests {@link ICoordinateFormat#latToString(org.openstreetmap.josm.data.coor.ILatLon)}
      * and {@link ICoordinateFormat#lonToString(org.openstreetmap.josm.data.coor.ILatLon)}
Index: test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java b/test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java
--- a/test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java	(date 1696419256973)
@@ -5,24 +5,14 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link LatLonParser}.
  */
+@Projection
 class LatLonParserTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Unit test of {@link LatLonParser#parse} method.
      */
Index: test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java b/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
--- a/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(date 1696441691082)
@@ -10,10 +10,9 @@
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import nl.jqno.equalsverifier.EqualsVerifier;
@@ -21,15 +20,8 @@
 /**
  * Unit tests for class {@link LatLon}.
  */
+@Projection
 public class LatLonTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     private static final double EPSILON = 1e-6;
 
     /**
@@ -155,7 +147,7 @@
     }
 
     /**
-     * Unit test of {@link LatLon#LatLon(LatLon)}.
+     * Unit test of {@link LatLon#LatLon(ILatLon)}.
      */
     @Test
     void testCopyConstructor() {
Index: test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java b/test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java
--- a/test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java	(date 1696419256971)
@@ -6,26 +6,17 @@
 
 import java.text.DecimalFormat;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import nl.jqno.equalsverifier.EqualsVerifier;
 
 /**
  * Test the {@link PolarCoor} class.
  */
+@Projection
 class PolarCoorTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Test {@link PolarCoor#PolarCoor}
      */
Index: test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java b/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
--- a/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(date 1696419256974)
@@ -20,7 +20,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
@@ -31,27 +30,19 @@
 import org.openstreetmap.josm.data.gpx.GpxData.GpxDataChangeListener;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.io.GpxReaderTest;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.ListenerList;
 import org.openstreetmap.josm.tools.date.Interval;
 import org.xml.sax.SAXException;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import nl.jqno.equalsverifier.EqualsVerifier;
 import nl.jqno.equalsverifier.Warning;
 
 /**
  * Unit tests for class {@link GpxData}.
  */
+@Projection
 class GpxDataTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     private GpxData data;
 
     /**
@@ -338,8 +329,8 @@
         p1.setInstant(Instant.ofEpochMilli(100020));
         p2.setInstant(Instant.ofEpochMilli(200020));
 
-        data.addTrack(new GpxTrack(Arrays.asList(Arrays.asList(p2)), Collections.emptyMap()));
-        data.addTrack(new GpxTrack(Arrays.asList(Arrays.asList(p1)), Collections.emptyMap()));
+        data.addTrack(new GpxTrack(Collections.singletonList(Collections.singletonList(p2)), Collections.emptyMap()));
+        data.addTrack(new GpxTrack(Collections.singletonList(Collections.singletonList(p1)), Collections.emptyMap()));
 
         List<IGpxTrack> tracks = data.getOrderedTracks();
         assertEquals(2, tracks.size());
@@ -363,8 +354,8 @@
         p1.setInstant(Instant.ofEpochMilli(200020));
         p2.setInstant(Instant.ofEpochMilli(100020));
         p4.setInstant(Instant.ofEpochMilli(500020));
-        data.addTrack(new GpxTrack(Arrays.asList(Arrays.asList(p1, p2)), Collections.emptyMap()));
-        data.addTrack(new GpxTrack(Arrays.asList(Arrays.asList(p3, p4, p5)), Collections.emptyMap()));
+        data.addTrack(new GpxTrack(Collections.singletonList(Arrays.asList(p1, p2)), Collections.emptyMap()));
+        data.addTrack(new GpxTrack(Collections.singletonList(Arrays.asList(p3, p4, p5)), Collections.emptyMap()));
 
         Interval times = data.getMinMaxTimeForAllTracks().orElse(null);
         assertEquals("1970-01-01T00:01:40.020Z/1970-01-01T00:08:20.020Z", times.toString());
@@ -382,7 +373,7 @@
                 .map(ProjectionRegistry.getProjection()::eastNorth2latlon)
                 .map(WayPoint::new)
                 .collect(Collectors.toList());
-        data.addTrack(new GpxTrack(Arrays.asList(points), Collections.emptyMap()));
+        data.addTrack(new GpxTrack(Collections.singletonList(points), Collections.emptyMap()));
 
         WayPoint closeToMiddle = data.nearestPointOnTrack(new EastNorth(10, 0), 10);
         assertEquals(points.get(1), closeToMiddle);
@@ -405,7 +396,7 @@
     void testGetDataSources() {
         DataSource ds = new DataSource(new Bounds(0, 0, 1, 1), "test");
         data.dataSources.add(ds);
-        assertEquals(new ArrayList<>(Arrays.asList(ds)), new ArrayList<>(data.getDataSources()));
+        assertEquals(new ArrayList<>(Collections.singletonList(ds)), new ArrayList<>(data.getDataSources()));
     }
 
     /**
@@ -428,7 +419,7 @@
         Bounds bounds = new Bounds(0, 0, 1, 1);
         DataSource ds = new DataSource(bounds, "test");
         data.dataSources.add(ds);
-        assertEquals(Arrays.asList(bounds), data.getDataSourceBounds());
+        assertEquals(Collections.singletonList(bounds), data.getDataSourceBounds());
     }
 
     /**
Index: test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java b/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java
--- a/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyleTest.java	(date 1696419256975)
@@ -28,17 +28,10 @@
 import java.util.stream.Collectors;
 
 import javax.imageio.ImageIO;
-import jakarta.json.Json;
-import jakarta.json.JsonObject;
-import jakarta.json.JsonObjectBuilder;
-import jakarta.json.JsonReader;
-import jakarta.json.JsonStructure;
-import jakarta.json.JsonValue;
 
 import org.awaitility.Awaitility;
 import org.awaitility.Durations;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.io.TempDir;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -48,26 +41,30 @@
 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction;
 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule;
 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.ImageProvider;
 
+import jakarta.json.Json;
+import jakarta.json.JsonObject;
+import jakarta.json.JsonObjectBuilder;
+import jakarta.json.JsonReader;
+import jakarta.json.JsonStructure;
+import jakarta.json.JsonValue;
 import nl.jqno.equalsverifier.EqualsVerifier;
 
 /**
  * Test class for {@link MapboxVectorStyle}
  * @author Taylor Smock
  */
-public class MapboxVectorStyleTest {
+// Needed for osm primitives (we really just need to initialize the config)
+// OSM primitives are called when we load style sources
+@BasicPreferences
+class MapboxVectorStyleTest {
     /** Used to store sprite files (specifically, sprite{,@2x}.{png,json}) */
     @TempDir
     File spritesDirectory;
 
-    // Needed for osm primitives (we really just need to initialize the config)
-    // OSM primitives are called when we load style sources
-    @RegisterExtension
-    JOSMTestRules rules = new JOSMTestRules();
-
     /** The base information */
     private static final String BASE_STYLE = "'{'\"version\":8,\"name\":\"test_style\",\"owner\":\"josm test\",\"id\":\"{0}\",{1}'}'";
     /** Source 1 */
@@ -86,11 +83,11 @@
     @Test
     void testVersionChecks() {
         assertThrows(NullPointerException.class, () -> new MapboxVectorStyle(JsonValue.EMPTY_JSON_OBJECT));
-        IllegalArgumentException badVersion = assertThrows(IllegalArgumentException.class,
-          () -> new MapboxVectorStyle(Json.createObjectBuilder().add("version", 7).build()));
+        final JsonObject style7 = Json.createObjectBuilder().add("version", 7).build();
+        IllegalArgumentException badVersion = assertThrows(IllegalArgumentException.class, () -> new MapboxVectorStyle(style7));
         assertEquals("Vector Tile Style Version not understood: version 7 (json: {\"version\":7})", badVersion.getMessage());
-        badVersion = assertThrows(IllegalArgumentException.class,
-          () -> new MapboxVectorStyle(Json.createObjectBuilder().add("version", 9).build()));
+        final JsonObject style9 = Json.createObjectBuilder().add("version", 9).build();
+        badVersion = assertThrows(IllegalArgumentException.class, () -> new MapboxVectorStyle(style9));
         assertEquals("Vector Tile Style Version not understood: version 9 (json: {\"version\":9})", badVersion.getMessage());
         assertDoesNotThrow(() -> new MapboxVectorStyle(Json.createObjectBuilder().add("version", 8).build()));
     }
Index: test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java b/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java
--- a/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java	(date 1696432056343)
@@ -17,13 +17,14 @@
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.annotations.BasicWiremock;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.client.WireMock;
 
-import org.openstreetmap.josm.testutils.annotations.Projection;
-
+@BasicPreferences(true)
 @BasicWiremock
 @Projection
 class WMSEndpointTileSourceTest implements TileSourceTest {
Index: test/unit/org/openstreetmap/josm/data/osm/MultipolygonBuilderTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/osm/MultipolygonBuilderTest.java b/test/unit/org/openstreetmap/josm/data/osm/MultipolygonBuilderTest.java
--- a/test/unit/org/openstreetmap/josm/data/osm/MultipolygonBuilderTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/osm/MultipolygonBuilderTest.java	(date 1696419256977)
@@ -5,26 +5,18 @@
 
 import java.io.InputStream;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of the {@code MultipolygonBuilder} class.
  */
+@Projection
+@Timeout(15)
 class MultipolygonBuilderTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().timeout(15000);
-
     /**
      * Non-regression test for ticket #12376.
      * @throws Exception if an error occurs
Index: test/unit/org/openstreetmap/josm/data/osm/NodeTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java b/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java
--- a/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java	(date 1696419256978)
@@ -5,31 +5,21 @@
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of the {@code Node} class.
  */
+@Projection
 class NodeTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Non-regression test for ticket #12060.
      */
Index: test/unit/org/openstreetmap/josm/data/osm/NoteDataTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/osm/NoteDataTest.java b/test/unit/org/openstreetmap/josm/data/osm/NoteDataTest.java
--- a/test/unit/org/openstreetmap/josm/data/osm/NoteDataTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/osm/NoteDataTest.java	(date 1696419256979)
@@ -7,31 +7,21 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.notes.Note;
 import org.openstreetmap.josm.data.notes.Note.State;
 import org.openstreetmap.josm.data.notes.NoteComment;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Unit tests of the {@code NoteData} class.
  */
+@BasicPreferences
 class NoteDataTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
-
     /**
      * Unit test for {@link NoteData#NoteData}
      */
@@ -39,7 +29,7 @@
     void testNoteData() {
         NoteData empty = new NoteData();
         assertEquals(0, empty.getNotes().size());
-        NoteData notEmpty = new NoteData(Arrays.asList(new Note(LatLon.ZERO)));
+        NoteData notEmpty = new NoteData(Collections.singletonList(new Note(LatLon.ZERO)));
         assertEquals(1, notEmpty.getNotes().size());
     }
 
@@ -53,7 +43,7 @@
         assertNull(note.getClosedAt());
         assertTrue(note.getComments().isEmpty());
 
-        NoteData data = new NoteData(Arrays.asList(note));
+        NoteData data = new NoteData(Collections.singletonList(note));
         data.closeNote(note, "foo");
 
         assertEquals(State.CLOSED, note.getState());
Index: test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java b/test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java
--- a/test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java	(date 1696419256980)
@@ -3,25 +3,15 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 
 /**
  * Unit tests of {@link JosmUrls} class.
  */
+@OsmApi(OsmApi.APIType.DEV)
 class JosmUrlsTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().devAPI();
-
     /**
      * Unit test of {@link JosmUrls#getBaseUserUrl}.
      */
Index: test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java b/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
--- a/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(date 1696960405456)
@@ -36,12 +36,12 @@
 import java.util.regex.Pattern;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.gui.preferences.projection.CodeProjectionChoice;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids;
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.PlatformManager;
 
@@ -56,12 +56,14 @@
  * the full path of the executable). Make sure the required *.gsb grid files
  * can be accessed, i.e. copy them from <code>nodist/data/projection</code> to <code>/usr/share/proj</code> or
  * wherever cs2cs expects them to be placed.
- *
+ * <p>
  * The input parameter for the external library is <em>not</em> the projection code
  * (e.g. "EPSG:25828"), but the entire definition, (e.g. "+proj=utm +zone=28 +ellps=GRS80 +nadgrids=null").
  * This means the test does not verify our definitions, but the correctness
  * of the algorithm, given a certain definition.
  */
+@ProjectionNadGrids
+@Timeout(90)
 class ProjectionRefTest {
 
     private static final String CS2CS_EXE = "cs2cs";
@@ -86,13 +88,6 @@
     static boolean debug;
     static List<String> forcedCodes;
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projectionNadGrids().timeout(90_000);
-
     /**
      * Program entry point.
      * @param args optional comma-separated list of projections to update. If set, only these projections will be updated
Index: test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java b/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
--- a/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(date 1696942480651)
@@ -24,6 +24,7 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids;
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Platform;
 import org.openstreetmap.josm.tools.Utils;
@@ -137,6 +138,7 @@
      * Non-regression unit test.
      * @throws IOException if any I/O error occurs
      */
+    @ProjectionNadGrids
     @Test
     void testNonRegression() throws IOException {
         // Disable on Github Windows runners + Java 8, minor differences appeared around 2021-07-20
Index: test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java b/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java
--- a/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java	(date 1696943671680)
@@ -15,6 +15,7 @@
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.ILatLon;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids;
 
 /**
  * Unit tests for class {@link Projection}.
@@ -29,6 +30,7 @@
     /**
      * Tests that projections are numerically stable in their definition bounds (round trip error &lt; 1e-5)
      */
+    @ProjectionNadGrids
     @Test
     void testProjections() {
         error = false;
Index: test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java b/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
--- a/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java	(date 1696960591028)
@@ -6,27 +6,18 @@
 
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids;
 
 /**
  * Unit tests for the Swiss projection grid.
  */
+@ProjectionNadGrids
 class SwissGridTest {
     private static final String SWISS_EPSG_CODE = "EPSG:21781";
     private final boolean debug = false;
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projectionNadGrids();
-
     /**
      * Setup test.
      */
Index: test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java	(date 1696419256983)
@@ -6,25 +6,16 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.TaggingPresets;
 
 /**
  * Unit test of {@link ConditionalKeys}.
  */
+@TaggingPresets
 class ConditionalKeysTest {
 
     private final ConditionalKeys test = new ConditionalKeys();
 
-    /**
-     * Setup test
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rule = new JOSMTestRules().presets();
-
     /**
      * Setup test
      * @throws Exception if an error occurs
Index: test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java	(date 1696419256984)
@@ -11,7 +11,6 @@
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -24,22 +23,15 @@
 import org.openstreetmap.josm.data.validation.tests.CrossingWays.SelfCrossing;
 import org.openstreetmap.josm.data.validation.tests.CrossingWays.Ways;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit test of {@link CrossingWays}.
  */
+@BasicPreferences
+@Projection
 class CrossingWaysTest {
-
-    /**
-     * Setup test
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rule = new JOSMTestRules().preferences().projection();
-
     private static Way newUsableWay(String tags) {
         return TestUtils.newWay(tags, new Node(LatLon.NORTH_POLE), new Node(LatLon.ZERO));
     }
Index: test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java	(date 1696419256985)
@@ -7,28 +7,25 @@
 import java.io.InputStream;
 import java.util.stream.Collectors;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
+import org.openstreetmap.josm.testutils.annotations.Projection;
+import org.openstreetmap.josm.testutils.annotations.TaggingPresets;
 
 /**
  * JUnit Test of Multipolygon validation test.
  */
+@BasicPreferences
+@Main
+@MapPaintStyles
+@Projection
+@TaggingPresets
 class MultipolygonTestTest {
-
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main().preferences();
-
     /**
      * Test all error cases manually created in multipolygon.osm.
      * @throws Exception in case of error
Index: test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java	(date 1696419256987)
@@ -8,7 +8,6 @@
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmUtils;
@@ -16,21 +15,13 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.validation.TestError;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.TaggingPresets;
 
 /**
  * Unit tests of {@link RelationChecker} class.
  */
+@TaggingPresets
 class RelationCheckerTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rule = new JOSMTestRules().presets();
-
     private static RelationChecker getRelationChecker() {
         RelationChecker checker = new RelationChecker();
         checker.initialize();
Index: test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java	(date 1696419256988)
@@ -13,29 +13,19 @@
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
 import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.data.validation.Severity;
 import org.openstreetmap.josm.data.validation.TestError;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.TaggingPresets;
 
 /**
  * JUnit Test of {@link TagChecker}.
  */
+@TaggingPresets
 class TagCheckerTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rule = new JOSMTestRules().presets();
-
     List<TestError> test(OsmPrimitive primitive) throws IOException {
         final TagChecker checker = new TagChecker() {
             @Override
Index: test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java	(date 1696419256989)
@@ -1,28 +1,25 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.data.validation.tests;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
+import org.openstreetmap.josm.testutils.annotations.Projection;
+import org.openstreetmap.josm.testutils.annotations.TaggingPresets;
 
 /**
  * JUnit Test of turn restriction validation test.
  */
+@Main
+@MapPaintStyles
+@Projection
+@TaggingPresets
 class TurnRestrictionTestTest {
 
     private static final TurnrestrictionTest TURNRESTRICTION_TEST = new TurnrestrictionTest();
     private static final RelationChecker RELATION_TEST = new RelationChecker();
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main();
-
     /**
      * Test all error cases manually created in restriction.osm.
      * @throws Exception in case of error
Index: test/unit/org/openstreetmap/josm/data/validation/tests/UnclosedWaysTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/UnclosedWaysTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/UnclosedWaysTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/UnclosedWaysTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/UnclosedWaysTest.java	(date 1696419256990)
@@ -8,7 +8,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -18,22 +17,17 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.mappaint.ElemStyles;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
+import org.openstreetmap.josm.testutils.annotations.Projection;
+import org.openstreetmap.josm.testutils.annotations.TaggingPresets;
 
 /**
  * JUnit Test of unclosed ways validation test.
  */
+@MapPaintStyles
+@Projection
+@TaggingPresets
 class UnclosedWaysTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets();
-
     private static Way createUnclosedWay(String tags, DataSet ds) {
         List<Node> nodes = new ArrayList<>();
         nodes.add(new Node(new LatLon(0, 1)));
Index: test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java b/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java	(date 1696419256982)
@@ -7,25 +7,16 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.validation.tests.Addresses;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import net.trajano.commons.testing.UtilityClassTestUtil;
 
 /**
  * Unit tests for class {@link OsmValidator}.
  */
+@Projection
 class OsmValidatorTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Setup test.
      * @throws Exception if an error occurs
Index: test/unit/org/openstreetmap/josm/data/validation/ValidatorCLITest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/ValidatorCLITest.java b/test/unit/org/openstreetmap/josm/data/validation/ValidatorCLITest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/ValidatorCLITest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/validation/ValidatorCLITest.java	(date 1696938885746)
@@ -24,12 +24,6 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import jakarta.json.Json;
-import jakarta.json.JsonObject;
-import jakarta.json.JsonReader;
-
-import mockit.Mock;
-import mockit.MockUp;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -49,15 +43,23 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.testutils.annotations.AnnotationUtils;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Territories;
 import org.openstreetmap.josm.testutils.annotations.ThreadSync;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
+import jakarta.json.Json;
+import jakarta.json.JsonObject;
+import jakarta.json.JsonReader;
+import mockit.Mock;
+import mockit.MockUp;
+
 /**
  * Test class for {@link ValidatorCLI}
  * @author Taylor Smock
  */
 @BasicPreferences
+@Territories
 class ValidatorCLITest {
     @RegisterExtension
     ThreadSync.ThreadSyncExtension threadSync = new ThreadSync.ThreadSyncExtension();
Index: test/unit/org/openstreetmap/josm/data/vector/VectorDataSetTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/vector/VectorDataSetTest.java b/test/unit/org/openstreetmap/josm/data/vector/VectorDataSetTest.java
--- a/test/unit/org/openstreetmap/josm/data/vector/VectorDataSetTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/vector/VectorDataSetTest.java	(date 1696419256991)
@@ -14,18 +14,18 @@
 import org.awaitility.Durations;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.RepeatedTest;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.vectortile.mapbox.MVTTile;
 import org.openstreetmap.josm.data.imagery.vectortile.mapbox.MapboxVectorCachedTileLoader;
 import org.openstreetmap.josm.data.imagery.vectortile.mapbox.MapboxVectorTileSource;
 import org.openstreetmap.josm.gui.layer.imagery.MVTLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * A test for {@link VectorDataSet}
  */
+@Projection
 class VectorDataSetTest {
     /**
      * Make some methods available for this test class
@@ -63,9 +63,6 @@
         }
     }
 
-    @RegisterExtension
-    JOSMTestRules rule = new JOSMTestRules().projection();
-
     /**
      * Load arbitrary tiles
      * @param layer The layer to add the tiles to
Index: test/unit/org/openstreetmap/josm/data/vector/VectorNodeTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/vector/VectorNodeTest.java b/test/unit/org/openstreetmap/josm/data/vector/VectorNodeTest.java
--- a/test/unit/org/openstreetmap/josm/data/vector/VectorNodeTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/vector/VectorNodeTest.java	(date 1696419256992)
@@ -13,7 +13,6 @@
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -24,17 +23,15 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Test class for {@link VectorNode}
  * @author Taylor Smock
  * @since 17862
  */
+@Projection
 class VectorNodeTest {
-    @RegisterExtension
-    JOSMTestRules rule = new JOSMTestRules().projection();
-
     @Test
     void testLatLon() {
         VectorNode node = new VectorNode("test");
Index: test/unit/org/openstreetmap/josm/data/PreferencesTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/PreferencesTest.java b/test/unit/org/openstreetmap/josm/data/PreferencesTest.java
--- a/test/unit/org/openstreetmap/josm/data/PreferencesTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/data/PreferencesTest.java	(date 1696419256967)
@@ -3,24 +3,16 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 
 /**
  * Unit tests of {@link Preferences}.
  */
+@BasicPreferences
+@OsmApi(OsmApi.APIType.FAKE)
 class PreferencesTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI();
-
     /**
      * Test {@link Preferences#toXML}.
      */
Index: test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java b/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(date 1696419256997)
@@ -8,7 +8,6 @@
 import java.util.Collections;
 import java.util.stream.Stream;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
@@ -25,21 +24,17 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link OsmTransferHandler} class.
  */
+@BasicPreferences
+@Main
+@Projection
 class OsmTransferHandlerTest {
-    /**
-     * Prefs to use OSM primitives
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection().main();
-
     private final OsmTransferHandler transferHandler = new OsmTransferHandler();
 
     /**
Index: test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java	(date 1696419257003)
@@ -1,31 +1,23 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.dialogs.changeset;
 
-import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests of {@link ChangesetContentPanel} class.
  */
+@BasicPreferences
+@Main
 class ChangesetContentPanelTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().main();
-
     /**
      * Unit test of {@link ChangesetContentPanel#ChangesetContentPanel}.
      */
     @Test
     void testChangesetContentPanel() {
-        assertNotNull(new ChangesetContentPanel());
+        assertDoesNotThrow(ChangesetContentPanel::new);
     }
 }
Index: test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java	(date 1696419257005)
@@ -6,28 +6,23 @@
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
 import org.openstreetmap.josm.gui.dialogs.LayerListDialog.LayerListModel;
 import org.openstreetmap.josm.gui.dialogs.layer.LayerVisibilityAction.OpacitySlider;
 import org.openstreetmap.josm.gui.layer.TMSLayer;
 import org.openstreetmap.josm.gui.layer.TMSLayerTest;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link LayerVisibilityAction} class.
  */
+@BasicPreferences
+@Main
+@Projection
 class LayerVisibilityActionTest {
-    /**
-     * TMS layer needs prefs. Platform for LayerListDialog shortcuts.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection().main();
-
     /**
      * Unit test of {@link LayerVisibilityAction} class.
      */
Index: test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java	(date 1696419257006)
@@ -9,24 +9,14 @@
 import javax.swing.JTable;
 import javax.swing.table.DefaultTableModel;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Unit tests of {@link PropertiesCellRenderer} class.
  */
+@BasicPreferences
 class PropertiesCellRendererTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
-
     /**
      * Test of color rendering.
      */
Index: test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java	(date 1696432023845)
@@ -12,7 +12,6 @@
 import java.util.stream.Stream;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
@@ -25,17 +24,18 @@
 import org.openstreetmap.josm.gui.NavigatableComponent;
 import org.openstreetmap.josm.gui.PrimitiveHoverListener;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.ReflectionUtils;
 
 /**
  * Unit tests of {@link PropertiesDialog} class.
  */
-@BasicPreferences
+@BasicPreferences(true)
+@Main
+@Projection
 class PropertiesDialogTest {
-    @RegisterExtension
-    static JOSMTestRules rules = new JOSMTestRules().main().projection();
 
     private static String createSearchSetting(List<OsmPrimitive> sel, boolean sameType) {
         return PropertiesDialog.createSearchSetting("foo", sel, sameType).text;
Index: test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java	(date 1696419257008)
@@ -7,7 +7,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
@@ -22,23 +21,17 @@
 import org.openstreetmap.josm.gui.tagging.TagEditorModel;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetHandler;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * This class provides the basic test environment for relation editor actions.
  * @author Michael Zangl
  */
 @Disabled
+@BasicPreferences
+@Main
 public abstract class AbstractRelationEditorActionTest {
-    /**
-     * Platform for tooltips.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().main();
-
     protected OsmDataLayer layer;
 
     private SelectionTableModel selectionTableModel;
Index: test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java	(date 1696419257009)
@@ -12,32 +12,25 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link RelationSorter} class.
  */
+@BasicPreferences
+@Projection
 class RelationSorterTest {
 
     private final RelationSorter sorter = new RelationSorter();
     private DataSet testDataset;
 
-    /**
-     * Use Mercator projection
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
-
     /**
      * Load the test data set
      * @throws IllegalDataException if an error was found while parsing the data
Index: test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java	(date 1696419257010)
@@ -17,7 +17,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -26,26 +25,20 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link WayConnectionTypeCalculator} class.
  */
+@BasicPreferences
+@Projection
 class WayConnectionTypeCalculatorTest {
 
     private final RelationSorter sorter = new RelationSorter();
     private final WayConnectionTypeCalculator wayConnectionTypeCalculator = new WayConnectionTypeCalculator();
     private DataSet testDataset;
 
-    /**
-     * Use Mercator projection
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
-
     /**
      * Load the test data set
      * @throws IllegalDataException if an error was found while parsing the data
Index: test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java	(date 1696419256998)
@@ -4,7 +4,6 @@
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.Command;
@@ -13,22 +12,17 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link CommandStackDialog} class.
  */
+@BasicPreferences
+@Main
+@Projection
 class CommandStackDialogTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection().preferences();
-
     /**
      * Unit test of {@link CommandStackDialog} class - empty case.
      */
Index: test/unit/org/openstreetmap/josm/gui/dialogs/FilterDialogTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/FilterDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/FilterDialogTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/FilterDialogTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/FilterDialogTest.java	(date 1696432023861)
@@ -11,25 +11,22 @@
 
 import javax.swing.AbstractAction;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 import org.openstreetmap.josm.data.osm.Filter;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
 import org.openstreetmap.josm.tools.ReflectionUtils;
 
 /**
  * Test class for {@link FilterDialog}
  */
-@BasicPreferences
+@BasicPreferences(true)
+@Main
 class FilterDialogTest {
     private static final List<Filter> FILTERS = Stream.of("type:node", "type:way", "type:relation")
             .map(Filter::readFromString).map(Filter::new).collect(Collectors.toList());
 
-    @RegisterExtension
-    static JOSMTestRules josmTestRules = new JOSMTestRules().main();
-
     @ParameterizedTest
     @ValueSource(ints = {0, 1, 2})
     void testNonRegression22439(int indexToRemove) throws ReflectiveOperationException {
Index: test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java	(date 1696419257000)
@@ -11,7 +11,6 @@
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.SystemOfMeasurement;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -20,29 +19,23 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link InspectPrimitiveDialog} class.
  */
+@Main
+@MapPaintStyles
+@Projection
 class InspectPrimitiveDialogTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    static JOSMTestRules test = new JOSMTestRules().main().projection().mapStyles();
-
     /**
      * Setup test
      */
     @BeforeEach
     public void setUp() {
         SystemOfMeasurement.PROP_SYSTEM_OF_MEASUREMENT.put("METRIC");
-
     }
 
     /**
Index: test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java	(date 1696419257001)
@@ -1,27 +1,19 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.dialogs;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link MapPaintDialog} class.
  */
+@Main
+@Projection
 class MapPaintDialogTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link MapPaintDialog.InfoAction} class.
      */
Index: test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/NotesDialogTest.java	(date 1696419257002)
@@ -17,7 +17,6 @@
 import javax.swing.JList;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
@@ -35,18 +34,19 @@
 import org.openstreetmap.josm.gui.layer.NoteLayer;
 import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker;
 
 /**
  * Unit tests of {@link NotesDialog}
  */
 @BasicPreferences
+/* Only needed for {@link #testTicket21558} */
+@Main
+@Projection
 class NotesDialogTest {
-    /** Only needed for {@link #testTicket21558} */
-    @RegisterExtension
-    JOSMTestRules rules = new JOSMTestRules().main().projection();
     private Note createMultiLineNote() {
         Note note = new Note(LatLon.ZERO);
         note.setCreatedAt(Instant.now());
Index: test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java b/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java
--- a/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java	(date 1696419257011)
@@ -5,23 +5,13 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.junit.jupiter.api.Timeout;
 
 /**
  * Unit tests of {@link HelpContentReader} class.
  */
+@Timeout(30)
 class HelpContentReaderTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().timeout(30000);
-
     /**
      * Unit test of {@link HelpContentReader#fetchHelpTopicContent} - null case.
      */
Index: test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java b/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java
--- a/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java	(date 1696419257012)
@@ -7,8 +7,10 @@
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
+import java.awt.Color;
+
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
@@ -16,24 +18,16 @@
 import org.openstreetmap.josm.data.osm.history.History;
 import org.openstreetmap.josm.data.osm.history.HistoryDataSet;
 import org.openstreetmap.josm.data.osm.history.HistoryNode;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
-import java.awt.Color;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 
 /**
  * Unit tests of {@link HistoryBrowserModel} class.
  */
+@BasicPreferences
+@OsmApi(OsmApi.APIType.DEV)
+@Timeout(30)
 class HistoryBrowserModelTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(30000);
-
     /**
      * Test for {@link HistoryBrowserModel#HistoryBrowserModel}.
      */
Index: test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java b/test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java
--- a/test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java	(date 1696419257013)
@@ -6,8 +6,8 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -21,23 +21,17 @@
 import org.openstreetmap.josm.io.OsmHistoryReader;
 import org.openstreetmap.josm.io.OsmServerHistoryReader;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 import org.xml.sax.SAXException;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link HistoryLoadTask} class.
  */
+@BasicPreferences
+@OsmApi(OsmApi.APIType.DEV)
+@Timeout(20)
 class HistoryLoadTaskTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
-
     /**
      * Unit test of {@link HistoryLoadTask#getLoadingMessage}
      */
Index: test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java b/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java
--- a/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java	(date 1696419257014)
@@ -12,7 +12,6 @@
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.APIDataSet;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -22,14 +21,13 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.UploadStrategySpecification;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.AssertionsInEDT;
 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link AsynchronousUploadPrimitivesTask}.
  */
+@AssertionsInEDT
 class AsynchronousUploadPrimitivesTaskTest {
 
     private UploadStrategySpecification strategy;
@@ -38,13 +36,6 @@
     private Changeset changeset;
     private AsynchronousUploadPrimitivesTask uploadPrimitivesTask;
 
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().assertionsInEDT();
-
     /**
      * Bootstrap.
      */
Index: test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java b/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java
--- a/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java	(date 1696419257015)
@@ -14,18 +14,17 @@
 import javax.swing.JPanel;
 
 import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.UserIdentityManager;
 import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
 import org.openstreetmap.josm.testutils.mockers.WindowMocker;
 import org.openstreetmap.josm.tools.UserCancelException;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import mockit.Invocation;
 import mockit.Mock;
 import mockit.MockUp;
@@ -33,15 +32,9 @@
 /**
  * Unit tests of {@link DownloadOpenChangesetsTask} class.
  */
+@BasicPreferences
+@OsmApi(OsmApi.APIType.DEV)
 class DownloadOpenChangesetsTaskTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
-
     /**
      * OAuth wizard mocker.
      */
Index: test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java b/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java
--- a/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java	(date 1696419257016)
@@ -5,30 +5,24 @@
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import java.util.Arrays;
+import java.util.Collections;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 
 /**
  * Unit tests of {@link DownloadPrimitivesTask} class.
  */
+@BasicPreferences
+@OsmApi(OsmApi.APIType.DEV)
+@Timeout(20)
 class DownloadPrimitivesTaskTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
-
     /**
      * Test of {@link DownloadPrimitivesTask} class.
      */
@@ -37,7 +31,7 @@
         DataSet ds = new DataSet();
         assertTrue(ds.allPrimitives().isEmpty());
         SimplePrimitiveId pid = new SimplePrimitiveId(1, OsmPrimitiveType.NODE);
-        new DownloadPrimitivesTask(new OsmDataLayer(ds, "", null), Arrays.asList(pid), true).run();
+        new DownloadPrimitivesTask(new OsmDataLayer(ds, "", null), Collections.singletonList(pid), true).run();
         assertFalse(ds.allPrimitives().isEmpty());
         assertNotNull(ds.getPrimitiveById(pid));
     }
Index: test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java b/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java
--- a/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java	(date 1696419257018)
@@ -3,26 +3,18 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.io.UploadStrategy;
 import org.openstreetmap.josm.io.UploadStrategySpecification;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
 
 /**
  * Unit tests of {@link UploadStrategySelectionPanel} class.
  */
+@BasicPreferences
+@OsmApi(OsmApi.APIType.DEV)
 class UploadStrategySelectionPanelTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
-
     /**
      * Test of {@link UploadStrategySelectionPanel#UploadStrategySelectionPanel}.
      */
Index: test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java	(date 1696419257029)
@@ -5,23 +5,19 @@
 
 import java.util.Collections;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
-
-import org.junit.jupiter.api.Test;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests of {@link GeoImageLayer} class.
  */
 // Basic preferences are needed for OSM primitives
 @BasicPreferences
+@Main
 class GeoImageLayerTest {
-    @RegisterExtension
-    static JOSMTestRules josmTestRules = new JOSMTestRules().main();
-
     /**
      * Test that {@link GeoImageLayer#mergeFrom} throws IAE for invalid arguments
      */
Index: test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImagesLoaderTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImagesLoaderTest.java b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImagesLoaderTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImagesLoaderTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImagesLoaderTest.java	(date 1696419257030)
@@ -10,27 +10,17 @@
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.io.GpxReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Unit tests of {@link ImagesLoader} class.
  */
+@BasicPreferences
 class ImagesLoaderTest {
-
-    /**
-     * We need prefs for this.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
-
     /**
      * Unit test of {@link ImagesLoader} class.
      * @throws Exception if any error occurs
Index: test/unit/org/openstreetmap/josm/gui/layer/imagery/MVTLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/imagery/MVTLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/imagery/MVTLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/imagery/MVTLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/imagery/MVTLayerTest.java	(date 1696419257032)
@@ -15,7 +15,6 @@
 import org.awaitility.Durations;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 import org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener;
@@ -33,18 +32,18 @@
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.testutils.FakeGraphics;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.HTTP;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Test class for {@link MVTLayer}
  */
 @BasicPreferences
+@HTTP
+@Main
+@org.openstreetmap.josm.testutils.annotations.Projection
 class MVTLayerTest {
-    // Needed for setting HTTP factory and the main window/mapview
-    @RegisterExtension
-    JOSMTestRules josmTestRules = new JOSMTestRules().main().projection();
-
     MVTLayer testLayer;
 
     @BeforeEach
@@ -55,22 +54,22 @@
     }
 
     @Test
-    void getTileLoaderClass() {
+    void testGetTileLoaderClass() {
         assertEquals(MapboxVectorCachedTileLoader.class, this.testLayer.getTileLoaderClass());
     }
 
     @Test
-    void getCacheName() {
+    void testGetCacheName() {
         assertEquals("MVT", this.testLayer.getCacheName());
     }
 
     @Test
-    void getCache() {
+    void testGetCache() {
         assertNotNull(MVTLayer.getCache());
     }
 
     @Test
-    void getNativeProjections() {
+    void testGetNativeProjections() {
         assertArrayEquals(Collections.singleton(MVTFile.DEFAULT_PROJECTION).toArray(), this.testLayer.getNativeProjections().toArray());
     }
 
@@ -81,7 +80,7 @@
      */
     @ParameterizedTest
     @ValueSource(strings = {"EPSG:3857" /* WGS 84 */, "EPSG:4326" /* Mercator (default) */, "EPSG:32612" /* UTM 12 N */})
-    void ensureDifferentProjectionsAreFetched(final String projectionCode) throws ReflectiveOperationException {
+    void testEnsureDifferentProjectionsAreFetched(final String projectionCode) throws ReflectiveOperationException {
         final Projection originalProjection = ProjectionRegistry.getProjection();
         try {
             ProjectionRegistry.setProjection(Projections.getProjectionByCode(projectionCode));
@@ -103,18 +102,18 @@
     }
 
     @Test
-    void getTileSource() {
+    void testGetTileSource() {
         assertEquals(this.testLayer.getInfo().getUrl(), this.testLayer.getTileSource().getBaseUrl());
     }
 
     @Test
-    void createTile() {
+    void testCreateTile() {
         assertNotNull(this.testLayer.createTile(this.testLayer.getTileSource(), 3251, 6258, 14));
     }
 
     @ParameterizedTest
     @ValueSource(booleans = {true, false})
-    void getMenuEntries(final boolean isExpert) {
+    void testGetMenuEntries(final boolean isExpert) {
         ExpertToggleAction.getInstance().setExpert(isExpert);
         // For now, just ensure that nothing throws on implementation
         MainApplication.getLayerManager().addLayer(this.testLayer);
@@ -122,12 +121,12 @@
     }
 
     @Test
-    void getData() {
+    void testGetData() {
         assertNotNull(this.testLayer.getData());
     }
 
     @Test
-    void finishedLoading() throws ReflectiveOperationException {
+    void testFinishedLoading() throws ReflectiveOperationException {
         final MVTTile mvtTile = (MVTTile) this.testLayer.createTile(this.testLayer.getTileSource(), 3248, 6258, 14);
         final FinishedLoading finishedLoading = new FinishedLoading();
         mvtTile.addTileLoaderFinisher(finishedLoading);
Index: test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java	(date 1696419257033)
@@ -8,22 +8,19 @@
 import java.net.MalformedURLException;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.data.gpx.WayPoint;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests of {@link ImageMarker} class.
  */
 @BasicPreferences
+@Main
 class ImageMarkerTest {
-    @RegisterExtension
-    static JOSMTestRules josmTestRules = new JOSMTestRules().main();
-
     /**
      * Unit test of {@link ImageMarker#ImageMarker}.
      * @throws MalformedURLException never
Index: test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(date 1696419257034)
@@ -6,11 +6,10 @@
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import java.util.Arrays;
+import java.util.Collections;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxConstants;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -21,22 +20,17 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link MarkerLayer} class.
  */
+@BasicPreferences
+@Main
+@Projection
 class MarkerLayerTest {
-
-    /**
-     * For creating layers
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().preferences().projection();
-
     /**
      * Setup tests
      */
@@ -62,7 +56,7 @@
 
         GpxData gpx = new GpxData();
         WayPoint wpt = new WayPoint(LatLon.ZERO);
-        wpt.attr.put(GpxConstants.META_LINKS, Arrays.asList(new GpxLink("https://josm.openstreetmap.de")));
+        wpt.attr.put(GpxConstants.META_LINKS, Collections.singletonList(new GpxLink("https://josm.openstreetmap.de")));
         wpt.getExtensions().add("josm", "offset", "1.0");
         gpx.waypoints.add(wpt);
         wpt = new WayPoint(LatLon.ZERO);
Index: test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java	(date 1696419257019)
@@ -1,6 +1,7 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.layer;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -13,7 +14,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.gui.jmapviewer.Coordinate;
 import org.openstreetmap.gui.jmapviewer.Projected;
 import org.openstreetmap.gui.jmapviewer.Tile;
@@ -31,22 +31,15 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Test of the base {@link AbstractTileSourceLayer} class
  */
+@Projection
+@Main
 class AbstractTileSourceLayerTest {
-
-    /**
-     * Setup test
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().main();
-
     private static final class TMSTileStubSource extends AbstractTMSTileSource {
         private TMSTileStubSource() {
             super(new TileSourceInfo());
@@ -202,6 +195,6 @@
      */
     @Test
     void testTileSourceLayerPopup() {
-        assertNotNull(testLayer.new TileSourceLayerPopup(100, 100));
+        assertDoesNotThrow(() -> testLayer.new TileSourceLayerPopup(100, 100));
     }
 }
Index: test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java b/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java	(date 1696419257021)
@@ -22,27 +22,21 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.AutosaveTask.AutosaveLayerInfo;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link AutosaveTask}.
  */
+/* We need preferences and a home directory for this. */
+@BasicPreferences
+@Projection
 class AutosaveTaskTest {
-    /**
-     * We need preferences and a home directory for this.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
-
     private AutosaveTask task;
 
     /**
Index: test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java	(date 1696419257022)
@@ -11,24 +11,18 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Test of the base {@link Layer} class
  * @author Michael Zangl
  */
+@BasicPreferences
+/* We need projection */
+@Projection
 class LayerTest {
-    /**
-     * We need projection
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
-
     private Layer testLayer;
 
     /**
Index: test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java	(date 1696419257023)
@@ -15,7 +15,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.data.Bounds;
@@ -34,24 +33,17 @@
 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker;
 import org.openstreetmap.josm.tools.Logging;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link OsmDataLayer} class.
  */
+@Main
+@Projection
 class OsmDataLayerTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().main();
-
     private DataSet ds;
     private OsmDataLayer layer;
 
Index: test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java	(date 1696419257025)
@@ -4,26 +4,18 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
 import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link TMSLayer} class.
  */
+@Main
+@Projection
 public class TMSLayerTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Creates a new TMS layer.
      * @return a new TMS layer
Index: test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java	(date 1696419257026)
@@ -6,26 +6,18 @@
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link ValidatorLayer} class.
  */
+@Main
+@Projection
 class ValidatorLayerTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().main();
-
     /**
      * Unit test of {@link ValidatorLayer#ValidatorLayer}.
      */
Index: test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java	(date 1696419257027)
@@ -5,26 +5,18 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
 import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link WMSLayer} class.
  */
+@Main
+@Projection
 class WMSLayerTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link WMSLayer#WMSLayer}.
      */
@@ -45,6 +37,7 @@
      */
     @Test
     void testTicket13828() {
-        assertThrows(IllegalArgumentException.class, () -> new WMSLayer(new ImageryInfo("TMS", "http://203.159.29.217/try2/{z}/{x}/{y}.png")));
+        final ImageryInfo info = new ImageryInfo("TMS", "http://203.159.29.217/try2/{z}/{x}/{y}.png");
+        assertThrows(IllegalArgumentException.class, () -> new WMSLayer(info));
     }
 }
Index: test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java	(date 1696419257028)
@@ -3,26 +3,18 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Unit tests of {@link WMTSLayer} class.
  */
+@BasicPreferences
+@Timeout(20)
 class WMTSLayerTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20000);
-
     /**
      * Unit test of {@link WMTSLayer#WMTSLayer}.
      */
Index: test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java
--- a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java	(date 1696419257035)
@@ -12,7 +12,6 @@
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
@@ -24,24 +23,16 @@
 import org.openstreetmap.josm.gui.mappaint.MultiCascade;
 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.ChildOrParentSelector;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link ChildOrParentSelector}.
  */
+@Projection
 class ChildOrParentSelectorTest {
 
     private DataSet ds;
 
-    /**
-     * Setup rule
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Setup test
      */
Index: test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java
--- a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java	(date 1696950132993)
@@ -32,6 +32,7 @@
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
 import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
@@ -171,6 +172,7 @@
     /**
      * Unit test of {@link Functions#JOSM_pref}, color handling
      */
+    @MapPaintStyles
     @Test
     void testPrefColor() {
         String key = "Functions.JOSM_pref";
Index: test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.java
--- a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.java	(date 1696419257037)
@@ -16,7 +16,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.EnumSource;
 import org.openstreetmap.josm.TestUtils;
@@ -31,25 +30,17 @@
 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context;
 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyCondition;
 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyMatchType;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.Logging;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link KeyCondition}.
  */
+@Projection
 class KeyConditionTest {
 
     private DataSet ds;
 
-    /**
-     * Setup rule
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Setup test
      */
@@ -165,7 +156,7 @@
      * Ensure that we are accounting for all necessary {@link ConditionFactory.KeyMatchType} are accounted for.
      * If this fails, and the key should not be fully matched against (i.e., it is a regex), please modify
      * {@link MapCSSRuleIndex#findAnyRequiredKey}.
-     *
+     * <p>
      * Non-regression test for JOSM #22073.
      */
     @ParameterizedTest
Index: test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.java
--- a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.java	(date 1696419257038)
@@ -9,7 +9,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
@@ -21,25 +20,17 @@
 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyValueCondition;
 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op;
 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.Logging;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link KeyValueCondition}.
  */
+@Projection
 class KeyValueConditionTest {
 
     private DataSet ds;
 
-    /**
-     * Setup rule
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     /**
      * Setup test
      */
Index: test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java
--- a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java	(date 1696419257039)
@@ -17,7 +17,6 @@
 import java.util.regex.Pattern;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 import org.openstreetmap.josm.TestUtils;
@@ -42,14 +41,13 @@
 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.ChildOrParentSelector;
 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser;
 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.ColorHelper;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link MapCSSParser}.
  */
+@Projection
 class MapCSSParserTest {
 
     protected static Environment getEnvironment(String key, String value) {
@@ -60,13 +58,6 @@
         return new MapCSSParser(new StringReader(stringToParse));
     }
 
-    /**
-     * Setup rule
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     @Test
     void testDeclarations() throws Exception {
         getParser("{ opacity: 0.5; color: rgb(1.0, 0.0, 0.0); }").declaration();
Index: test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.java b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.java
--- a/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.java	(date 1696419257040)
@@ -3,26 +3,16 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@code ParsingLinkSelector}.
  */
+@Projection
 class ParsingLinkSelectorTest {
-
-    /**
-     * Setup rule
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     @Test
-    public void parseEmptyChildSelector() {
+    void testParseEmptyChildSelector() {
         String css = "relation > way {}";
         MapCSSStyleSource source = new MapCSSStyleSource(css);
         source.loadStyleSource();
@@ -30,7 +20,7 @@
     }
 
     @Test
-    public void parseEmptyParentSelector() {
+    void testParseEmptyParentSelector() {
         String css = "way < relation {}";
         MapCSSStyleSource source = new MapCSSStyleSource(css);
         source.loadStyleSource();
@@ -38,7 +28,7 @@
     }
 
     @Test
-    public void parseChildSelectorWithKeyValueCondition() {
+    void testParseChildSelectorWithKeyValueCondition() {
         String css = "relation >[role=\"my_role\"] way {}";
         MapCSSStyleSource source = new MapCSSStyleSource(css);
         source.loadStyleSource();
@@ -46,7 +36,7 @@
     }
 
     @Test
-    public void parseChildSelectorWithKeyCondition() {
+    void testParseChildSelectorWithKeyCondition() {
         String css = "relation >[\"my_role\"] way{}";
         MapCSSStyleSource source = new MapCSSStyleSource(css);
         source.loadStyleSource();
Index: test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java
--- a/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java	(date 1696419257042)
@@ -5,26 +5,19 @@
 
 import javax.swing.JOptionPane;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Preferences;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.AssertionsInEDT;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link ExportProfileAction} class.
  */
+@AssertionsInEDT
+@BasicPreferences
 class ExportProfileActionTest {
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
-
     /**
      * Unit test of {@link ExportProfileAction#actionPerformed}.
      */
Index: test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java
--- a/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java	(date 1696419257043)
@@ -6,33 +6,26 @@
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import java.util.Arrays;
+import java.util.Collections;
 
 import javax.swing.JOptionPane;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.preferences.advanced.PreferencesTable.AllSettingsTableModel;
 import org.openstreetmap.josm.spi.preferences.StringSetting;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.AssertionsInEDT;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker;
 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link PreferencesTable} class.
  */
+@AssertionsInEDT
+@BasicPreferences
 class PreferencesTableTest {
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
-
     private static PrefEntry newPrefEntry(String value) {
         StringSetting val = new StringSetting(value);
         StringSetting def = new StringSetting("defaultValue");
@@ -40,7 +33,7 @@
     }
 
     private static PreferencesTable newTable() {
-        return new PreferencesTable(Arrays.asList(newPrefEntry("value")));
+        return new PreferencesTable(Collections.singletonList(newPrefEntry("value")));
     }
 
     /**
Index: test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java
--- a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java	(date 1696419257044)
@@ -4,29 +4,19 @@
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.File;
-import java.util.Arrays;
+import java.util.Collections;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests of {@link ImageryPreference} class.
  */
+@Main
 class ImageryPreferenceTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Unit test of {@link ImageryPreference#ImageryPreference}.
      */
@@ -41,7 +31,7 @@
     @Test
     void testAddGui() {
         String fileUrl = new File(TestUtils.getTestDataRoot()+"__files/imagery/maps.xml").toURI().toString();
-        Config.getPref().putList("imagery.layers.sites", Arrays.asList(fileUrl));
+        Config.getPref().putList("imagery.layers.sites", Collections.singletonList(fileUrl));
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ImageryPreference.Factory(), null);
     }
 }
Index: test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
--- a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java	(date 1696436437456)
@@ -28,6 +28,7 @@
 import org.apache.commons.jcs3.access.CacheAccess;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.parallel.Execution;
 import org.junit.jupiter.api.parallel.ExecutionMode;
@@ -434,6 +435,7 @@
     @Execution(ExecutionMode.CONCURRENT)
     @ParameterizedTest(name = "{0}")
     @MethodSource("data")
+    @Disabled("Takes a long time")
     void testImageryEntryValidity(String id, ImageryInfo info) {
         checkEntry(info);
         assertTrue(errors.isEmpty(), format(id, errors));
Index: test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java b/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java
--- a/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java	(date 1696419257045)
@@ -5,34 +5,26 @@
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.File;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.plugins.PluginDownloadTask;
 import org.openstreetmap.josm.plugins.PluginException;
 import org.openstreetmap.josm.plugins.PluginInformation;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.AssertionsInEDT;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link PluginPreference} class.
  */
+@AssertionsInEDT
+@BasicPreferences
 public class PluginPreferenceTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
-
     /**
      * Unit test of {@link PluginPreference#PluginPreference}.
      */
@@ -59,14 +51,14 @@
     void testBuildDownloadSummary() throws Exception {
         final PluginInformation dummy = getDummyPluginInformation();
         assertEquals("", PluginPreference.buildDownloadSummary(
-                new PluginDownloadTask(NullProgressMonitor.INSTANCE, Collections.<PluginInformation>emptyList(), "")));
+                new PluginDownloadTask(NullProgressMonitor.INSTANCE, Collections.emptyList(), "")));
         assertEquals("", PluginPreference.buildDownloadSummary(
-                new PluginDownloadTask(NullProgressMonitor.INSTANCE, Arrays.asList(dummy), "")));
+                new PluginDownloadTask(NullProgressMonitor.INSTANCE, Collections.singletonList(dummy), "")));
         assertEquals("The following plugin has been downloaded <strong>successfully</strong>:<ul><li>dummy_plugin (31772)</li></ul>"+
                      "Downloading the following plugin has <strong>failed</strong>:<ul><li>dummy_plugin</li></ul>"+
                      "<br>Error message(untranslated): test",
                 PluginPreference.buildDownloadSummary(
-                        new PluginDownloadTask(NullProgressMonitor.INSTANCE, Arrays.asList(dummy), "") {
+                        new PluginDownloadTask(NullProgressMonitor.INSTANCE, Collections.singletonList(dummy), "") {
                     @Override
                     public Collection<PluginInformation> getFailedPlugins() {
                         return Collections.singleton(dummy);
Index: test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java
--- a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java	(date 1696419257048)
@@ -6,25 +6,15 @@
 
 import javax.swing.JPanel;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests of {@link Check} class.
  */
+@Main
 class CheckTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Unit test for {@link Check#addToPanel}.
      */
Index: test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java
--- a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java	(date 1696419257049)
@@ -9,26 +9,20 @@
 import javax.swing.JPanel;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.I18n;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests of {@link Combo} class.
  */
+@BasicPreferences
+@I18n("de")
+@Main
 class ComboTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().main().i18n("de");
-
     /**
      * Unit test for {@link Combo#addToPanel}.
      */
Index: test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java
--- a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java	(date 1696939058013)
@@ -8,10 +8,12 @@
 
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests of {@link MultiSelect} class.
  */
+@Main
 class MultiSelectTest {
     /**
      * Unit test for {@link MultiSelect#addToPanel}.
Index: test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java
--- a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java	(date 1696419257050)
@@ -7,25 +7,15 @@
 
 import javax.swing.JPanel;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.TaggingPresets;
 
 /**
  * Unit tests of {@link PresetLink} class.
  */
+@TaggingPresets
 class PresetLinkTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rule = new JOSMTestRules().presets();
-
     /**
      * Unit test for {@link PresetLink#addToPanel}.
      */
Index: test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java
--- a/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java	(date 1696419257051)
@@ -6,25 +6,15 @@
 
 import javax.swing.JPanel;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
 
 /**
  * Unit tests of {@link Text} class.
  */
+@Main
 class TextTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Unit test for {@link Text#addToPanel}.
      */
Index: test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java b/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
--- a/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java	(date 1696439847933)
@@ -77,7 +77,7 @@
      * @throws IOException if any I/O error occurs
      */
     @Test
-    void testReadDefaulPresets() throws SAXException, IOException {
+    void testReadDefaultPresets() throws SAXException, IOException {
         String presetfile = "resource://data/defaultpresets.xml";
         final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(presetfile, true);
         assertTrue(presets.size() > 0, "Default presets are empty");
Index: test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java b/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java
--- a/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java	(date 1696419257047)
@@ -14,30 +14,22 @@
 import javax.swing.JMenu;
 import javax.swing.JSeparator;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import net.trajano.commons.testing.UtilityClassTestUtil;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 import org.openstreetmap.josm.actions.PreferencesAction;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MainMenu;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
 import org.openstreetmap.josm.tools.Logging;
 
+import net.trajano.commons.testing.UtilityClassTestUtil;
+
 /**
  * Unit tests of {@link TaggingPresets} class.
  */
+@Main
 public class TaggingPresetsTest {
-
-    /**
-     * Setup rule
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Tests that {@code TaggingPresets} satisfies utility class criteria.
      * @throws ReflectiveOperationException if an error occurs
Index: test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetValidationTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetValidationTest.java b/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetValidationTest.java
--- a/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetValidationTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetValidationTest.java	(date 1696419257046)
@@ -4,38 +4,28 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import java.util.Arrays;
-import java.util.Locale;
+import java.util.Collections;
 
 import javax.swing.JLabel;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
 import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.data.validation.OsmValidator;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.I18n;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for {@code TaggingPresetValidation}
  */
+@Projection
+@I18n
 class TaggingPresetValidationTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rule = new JOSMTestRules().projection();
-
     @BeforeEach
     void setUp() {
-        Locale.setDefault(Locale.ENGLISH);
         OsmValidator.initialize();
     }
 
@@ -68,7 +58,7 @@
     void testApplyChangedTags() {
         OsmPrimitive primitive = OsmUtils.createPrimitive("way incline=10m width=1mm opening_hours=\"Mo-Fr 8-10\"");
         new DataSet(primitive);
-        OsmPrimitive clone = TaggingPresetValidation.applyChangedTags(primitive, Arrays.asList(new Tag("incline", "20m")));
+        OsmPrimitive clone = TaggingPresetValidation.applyChangedTags(primitive, Collections.singletonList(new Tag("incline", "20m")));
         assertEquals("20m", clone.get("incline"));
         assertEquals("1mm", clone.get("width"));
     }
Index: test/unit/org/openstreetmap/josm/gui/MapScalerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java b/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java
--- a/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java	(date 1696419256993)
@@ -7,28 +7,20 @@
 
 import java.awt.Color;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MapScaler.AccessibleMapScaler;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link MapScaler} class.
  */
+@Main
+@Projection
 class MapScalerTest {
-
-    /**
-     * Setup tests
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Unit test of {@link MapScaler#MapScaler}.
      */
Index: test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java b/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java
--- a/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java	(date 1696419256994)
@@ -8,34 +8,26 @@
 import java.util.Arrays;
 import java.util.function.Function;
 
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.MapViewState.MapViewPoint;
 import org.openstreetmap.josm.gui.MapViewState.MapViewRectangle;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Test {@link MapViewState}
  * @author Michael Zangl
  */
+@Projection
 class MapViewStateTest {
 
     private static final int WIDTH = 301;
     private static final int HEIGHT = 200;
     private MapViewState state;
 
-    /**
-     * Setup test.
-     */
-    @BeforeAll
-    public static void setUpBeforeClass() {
-        JOSMFixture.createUnitTestFixture().init();
-    }
-
     /**
      * Create the default state.
      */
Index: test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java b/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
--- a/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(date 1696419256995)
@@ -21,7 +21,6 @@
 import org.hamcrest.Matcher;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.ProjectionBounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -31,15 +30,16 @@
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Some tests for the {@link NavigatableComponent} class.
  * @author Michael Zangl
  *
  */
+@BasicPreferences
+@Projection // We need the projection for coordinate conversions.
 class NavigatableComponentTest {
 
     private static final class NavigatableComponentMock extends NavigatableComponent {
@@ -63,13 +63,6 @@
     private static final int WIDTH = 300;
     private NavigatableComponentMock component;
 
-    /**
-     * We need the projection for coordinate conversions.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
-
     /**
      * Create a new, fresh {@link NavigatableComponent}
      */
@@ -264,7 +257,7 @@
 
     /**
      * Check that EastNorth is the same as expected after zooming the NavigatableComponent.
-     *
+     * <p>
      * Adds tolerance of 0.5 pixel for pixel grid alignment, see
      * {@link NavigatableComponent#zoomTo(EastNorth, double, boolean)}
      * @param expected expected
Index: test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java b/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java
--- a/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java	(date 1696419256996)
@@ -14,31 +14,29 @@
 import javax.swing.JTable;
 import javax.swing.table.TableCellRenderer;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.ReflectionUtils;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Checks if all classes implementing the {@link TableCellRenderer} interface do
  * accept a null value as second parameter for
  * {@link TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable,
  * java.lang.Object, boolean, boolean, int, int)}.
- *
+ * <p>
  * For unknown reason java sometimes call getTableCellRendererComponent method
  * with value = null. Every implementation of {@code getTableCellRendererComponent}
  * must fail gracefully when null is passed as value parameter.
- *
+ * <p>
  * This test scans the classpath for classes implementing {@code TableCellRenderer},
  * creates an instance and calls {@code getTableCellRendererComponent} with null
  * value to check if a NPE is thrown.
  *
  * @see <a href="https://josm.openstreetmap.de/ticket/6301">#6301</a>
  */
+@Main
 class TableCellRendererTest {
 
     // list of classes that cannot be easily tested and are verified either manually or another unit tests
@@ -47,21 +45,11 @@
         "org.openstreetmap.josm.gui.dialogs.relation.SelectionTableCellRenderer"
     );
 
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Unit test of all table cell renderers against null values.
-     * @throws NoSuchMethodException no default constructor - to fix this, add a default constructor to the class
-     *                               or add the class to the SKIP_TEST list above
-     * @throws ReflectiveOperationException if an error occurs
      */
     @Test
-    void testTableCellRenderer() throws ReflectiveOperationException {
+    void testTableCellRenderer() {
         Set<Class<? extends TableCellRenderer>> renderers = TestUtils.getJosmSubtypes(TableCellRenderer.class);
         assertTrue(renderers.size() >= 10); // if it finds less than 10 classes, something is broken
         JTable tbl = new JTable(2, 2);
Index: test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java b/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java
--- a/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java	(date 1696432109874)
@@ -11,30 +11,22 @@
 import java.util.List;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.io.imagery.WMSImagery.WMSGetCapabilitiesException;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.testutils.annotations.BasicWiremock;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.client.WireMock;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link WMSImagery} class.
  */
+@BasicPreferences(true)
 @BasicWiremock
+@Projection
 class WMSImageryTest {
-
-    /**
-     * Setup test
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    JOSMTestRules test = new JOSMTestRules().projection();
-
     @BasicWiremock
     WireMockServer tileServer;
 
Index: test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java
--- a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java	(date 1696419257055)
@@ -5,27 +5,22 @@
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.AssertionsInEDT;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link AddNodeHandler} class.
  */
+@AssertionsInEDT
+@Main
+@Projection
 class AddNodeHandlerTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().assertionsInEDT().projection();
-
     private static AddNodeHandler newHandler(String url) throws RequestHandlerBadRequestException {
         AddNodeHandler req = new AddNodeHandler();
         if (url != null)
@@ -37,8 +32,9 @@
      * Unit test for bad request - no layer.
      */
     @Test
-    void testBadRequestNoLayer() {
-        Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost?lat=0&lon=0").handle());
+    void testBadRequestNoLayer() throws RequestHandlerBadRequestException {
+        final AddNodeHandler handler = newHandler("https://localhost?lat=0&lon=0");
+        Exception e = assertThrows(RequestHandlerBadRequestException.class, handler::handle);
         assertEquals("There is no layer opened to add node", e.getMessage());
     }
 
@@ -46,10 +42,11 @@
      * Unit test for bad request - no param.
      */
     @Test
-    void testBadRequestNoParam() {
+    void testBadRequestNoParam() throws RequestHandlerBadRequestException {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         MainApplication.getLayerManager().addLayer(layer);
-        Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler(null).handle());
+        final AddNodeHandler handler = newHandler(null);
+        Exception e = assertThrows(RequestHandlerBadRequestException.class, handler::handle);
         assertEquals("NumberFormatException (empty String)", e.getMessage());
     }
 
@@ -57,8 +54,9 @@
      * Unit test for bad request - invalid URL.
      */
     @Test
-    void testBadRequestInvalidUrl() {
-        Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("invalid_url").handle());
+    void testBadRequestInvalidUrl() throws RequestHandlerBadRequestException {
+        final AddNodeHandler handler = newHandler("invalid_url");
+        Exception e = assertThrows(RequestHandlerBadRequestException.class, handler::handle);
         assertEquals("The following keys are mandatory, but have not been provided: lat, lon", e.getMessage());
     }
 
@@ -66,8 +64,9 @@
      * Unit test for bad request - incomplete URL.
      */
     @Test
-    void testBadRequestIncompleteUrl() {
-        Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost").handle());
+    void testBadRequestIncompleteUrl() throws RequestHandlerBadRequestException {
+        final AddNodeHandler handler = newHandler("https://localhost");
+        Exception e = assertThrows(RequestHandlerBadRequestException.class, handler::handle);
         assertEquals("The following keys are mandatory, but have not been provided: lat, lon", e.getMessage());
     }
 
Index: test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java
--- a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java	(date 1696441984856)
@@ -1,34 +1,25 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.io.remotecontrol.handler;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.io.File;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
 import org.openstreetmap.josm.tools.Utils;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link ImportHandler} class.
  */
+@Main
 class ImportHandlerTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main();
-
     private static ImportHandler newHandler(String url) throws RequestHandlerBadRequestException {
         ImportHandler req = new ImportHandler();
         if (url != null)
@@ -52,8 +43,14 @@
      */
     @Test
     void testBadRequestNoParam() throws Exception {
-        Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler(null).handle());
-        assertEquals("MalformedURLException: null", e.getMessage());
+        final ImportHandler handler = newHandler(null);
+        Exception e = assertThrows(RequestHandlerBadRequestException.class, handler::handle);
+        // This has differing behavior after Java 15
+        if ("MalformedURLException: null".length() == e.getMessage().length()) {
+            assertEquals("MalformedURLException: null", e.getMessage());
+        } else {
+            assertEquals("MalformedURLException: Cannot invoke \"String.length()\" because \"spec\" is null", e.getMessage());
+        }
     }
 
     /**
@@ -62,7 +59,8 @@
      */
     @Test
     void testBadRequestInvalidUrl() throws Exception {
-        Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost?url=invalid_url").handle());
+        final ImportHandler handler = newHandler("https://localhost?url=invalid_url");
+        Exception e = assertThrows(RequestHandlerBadRequestException.class, handler::handle);
         assertEquals("MalformedURLException: no protocol: invalid_url", e.getMessage());
     }
 
@@ -72,7 +70,8 @@
      */
     @Test
     void testBadRequestIncompleteUrl() throws Exception {
-        Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost").handle());
+        final ImportHandler handler = newHandler("https://localhost?lat=0&lon=0");
+        Exception e = assertThrows(RequestHandlerBadRequestException.class, handler::handle);
         assertEquals("The following keys are mandatory, but have not been provided: url", e.getMessage());
     }
 
Index: test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java b/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
--- a/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java	(date 1696419257057)
@@ -23,7 +23,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -41,15 +40,16 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.layer.TMSLayer;
 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 import org.openstreetmap.josm.tools.MultiMap;
 import org.openstreetmap.josm.tools.Utils;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests for Session writing.
  */
+@Main
+@Projection
 public class SessionWriterTest {
 
     protected static final class OsmHeadlessJosExporter extends OsmDataSessionExporter {
@@ -96,13 +96,6 @@
         }
     }
 
-    /**
-     * Setup tests.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().main();
-
     /**
      * Setup tests.
      */
Index: test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java b/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java
--- a/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java	(date 1696419257052)
@@ -9,28 +9,19 @@
 import java.nio.file.Paths;
 import java.util.Arrays;
 
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link GeoJSONWriter} class.
  */
+@Projection
 class GeoJSONWriterTest {
-
-    /**
-     * Setup test.
-     */
-    @BeforeAll
-    public static void setUp() {
-        JOSMFixture.createUnitTestFixture().init();
-    }
-
     /**
      * Unit test for Point
      */
Index: test/unit/org/openstreetmap/josm/io/ValidatorErrorWriterTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/io/ValidatorErrorWriterTest.java b/test/unit/org/openstreetmap/josm/io/ValidatorErrorWriterTest.java
--- a/test/unit/org/openstreetmap/josm/io/ValidatorErrorWriterTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/io/ValidatorErrorWriterTest.java	(date 1696419257053)
@@ -6,34 +6,23 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Locale;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.validation.Severity;
 import org.openstreetmap.josm.data.validation.TestError;
 import org.openstreetmap.josm.data.validation.tests.RightAngleBuildingTest;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Unit tests of {@link ValidatorErrorWriter}
  */
+@BasicPreferences
 class ValidatorErrorWriterTest {
-
-    /**
-     * Setup rule
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
-
     @Test
     void testEmpty() throws IOException {
         doTest(Collections.emptyList(), "");
@@ -42,9 +31,9 @@
     @Test
     void testErrors() throws IOException {
         Locale.setDefault(Locale.ENGLISH);
-        doTest(Arrays.asList(TestError.builder(new RightAngleBuildingTest(), Severity.OTHER, 3701)
-                .message("Building with an almost square angle")
-                .primitives(new Node(LatLon.NORTH_POLE)).build()),
+        doTest(Collections.singletonList(TestError.builder(new RightAngleBuildingTest(), Severity.OTHER, 3701)
+                        .message("Building with an almost square angle")
+                        .primitives(new Node(LatLon.NORTH_POLE)).build()),
                   "  <analyser timestamp='\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3,9}Z' name='Almost right angle buildings'>"
                 + "    <class id='1' level='3'>"
                 + "      <classtext lang='en' title='Building with an almost square angle'/>"
Index: test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java b/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java
--- a/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java	(date 1696419257058)
@@ -17,10 +17,6 @@
 import java.util.List;
 import java.util.stream.Collectors;
 
-import com.github.tomakehurst.wiremock.client.WireMock;
-import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
-import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
@@ -28,26 +24,24 @@
 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;
 import org.openstreetmap.josm.testutils.PluginServer;
 import org.openstreetmap.josm.testutils.annotations.AssumeRevision;
 import org.openstreetmap.josm.testutils.annotations.FullPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker;
 import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
 
+import com.github.tomakehurst.wiremock.client.WireMock;
+import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
+
 /**
  * Test parts of {@link PluginHandler} class when the reported JOSM version is too old for the plugin.
  */
 @AssumeRevision("Revision: 6000\n")
 @FullPreferences
+@Main
 class PluginHandlerJOSMTooOldTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    static JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Plugin server mock.
      */
Index: test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java b/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java
--- a/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java	(date 1696419257059)
@@ -16,10 +16,6 @@
 import java.util.Map;
 import java.util.stream.Collectors;
 
-import com.github.tomakehurst.wiremock.client.WireMock;
-import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
-import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
@@ -27,24 +23,22 @@
 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;
 import org.openstreetmap.josm.testutils.PluginServer;
 import org.openstreetmap.josm.testutils.annotations.AssumeRevision;
 import org.openstreetmap.josm.testutils.annotations.FullPreferences;
+import org.openstreetmap.josm.testutils.annotations.Main;
 import org.openstreetmap.josm.testutils.mockers.ExtendedDialogMocker;
 
+import com.github.tomakehurst.wiremock.client.WireMock;
+import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
+
 /**
  * Test parts of {@link PluginHandler} class with plugins that advertise multiple versions for compatibility.
  */
 @FullPreferences
+@Main
 class PluginHandlerMultiVersionTest {
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    static JOSMTestRules test = new JOSMTestRules().main();
-
     /**
      * Plugin server mock.
      */
Index: test/unit/org/openstreetmap/josm/testutils/annotations/BasicPreferences.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/BasicPreferences.java b/test/unit/org/openstreetmap/josm/testutils/annotations/BasicPreferences.java
--- a/test/unit/org/openstreetmap/josm/testutils/annotations/BasicPreferences.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/testutils/annotations/BasicPreferences.java	(date 1696438621998)
@@ -27,7 +27,12 @@
 
 /**
  * Allow tests to use JOSM preferences (see {@link JOSMTestRules#preferences()}).
- * This is often enough for basic tests.
+ * This is often enough for basic tests. There are two modes:
+ * <ul>
+ *     <li>Between test classes (usually enough) if annotated at the class level ({@link ElementType#TYPE})</li>
+ *     <li>Between test methods if annotated at the method level ({@link ElementType#METHOD})</li>
+ *     <li>Between test method if annotated at the class level <i>and</i> the annotated value is {@code true}</li>
+ * </ul>
  *
  * @author Taylor Smock
  * @see FullPreferences
@@ -39,6 +44,11 @@
 @Inherited
 @ExtendWith(BasicPreferences.BasicPreferencesExtension.class)
 public @interface BasicPreferences {
+    /**
+     * Clear preferences between tests
+     * @return {@code true} if the preferences should be cleared between tests
+     */
+    boolean value() default false;
 
     /**
      * Initialize basic preferences. This is often more than enough for basic tests.
@@ -79,7 +89,8 @@
 
         @Override
         public void beforeEach(ExtensionContext context) throws Exception {
-            if (AnnotationSupport.isAnnotated(context.getElement(), BasicPreferences.class) || Config.getPref() == null) {
+            if (AnnotationSupport.isAnnotated(context.getElement(), BasicPreferences.class) || Config.getPref() == null
+            || AnnotationUtils.findFirstParentAnnotation(context, BasicPreferences.class).map(BasicPreferences::value).orElse(false)) {
                 this.beforeAll(context);
             }
         }
Index: test/unit/org/openstreetmap/josm/testutils/annotations/I18n.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/I18n.java b/test/unit/org/openstreetmap/josm/testutils/annotations/I18n.java
--- a/test/unit/org/openstreetmap/josm/testutils/annotations/I18n.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/testutils/annotations/I18n.java	(date 1696419257061)
@@ -3,6 +3,7 @@
 
 import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
@@ -12,7 +13,6 @@
 import org.junit.jupiter.api.extension.BeforeEachCallback;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.jupiter.api.extension.ExtensionContext;
-import org.junit.platform.commons.support.AnnotationSupport;
 import org.openstreetmap.josm.tools.LanguageInfo;
 
 /**
@@ -22,6 +22,7 @@
  * @since 17914
  */
 @Documented
+@Inherited
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ElementType.TYPE, ElementType.METHOD})
 @ExtendWith(I18n.I18nExtension.class)
@@ -41,7 +42,7 @@
     class I18nExtension implements AfterEachCallback, BeforeEachCallback {
         @Override
         public void beforeEach(ExtensionContext context) {
-            String language = AnnotationSupport.findAnnotation(context.getElement(), I18n.class).map(I18n::value).orElse("en");
+            String language = AnnotationUtils.findFirstParentAnnotation(context, I18n.class).map(I18n::value).orElse("en");
             if (!Locale.getDefault().equals(LanguageInfo.getLocale(language, false))) {
                 org.openstreetmap.josm.tools.I18n.set(language);
             }
Index: test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java b/test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java
--- a/test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/testutils/annotations/JosmDefaults.java	(date 1696860051943)
@@ -9,7 +9,9 @@
 import java.lang.annotation.Target;
 import java.util.Arrays;
 
+import org.junit.jupiter.api.extension.AfterAllCallback;
 import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
 import org.junit.jupiter.api.extension.BeforeEachCallback;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.jupiter.api.extension.ExtensionContext;
@@ -24,6 +26,7 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MemoryManagerTest;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
  * Default actions taken by {@link JOSMTestRules}. Automatically registered.
@@ -37,10 +40,18 @@
      * Default actions taken by {@link JOSMTestRules}. Automatically registered.
      * Functionality that this provides may be moved to other classes.
      */
-    class DefaultsExtension implements BeforeEachCallback, AfterEachCallback {
+    class DefaultsExtension implements BeforeAllCallback, BeforeEachCallback, AfterAllCallback, AfterEachCallback {
+        private static final boolean PERFORM_MEMORY_CLEANUP =
+                !Boolean.parseBoolean(System.getProperty("test.without.gc", Boolean.FALSE.toString()));
+        private static final int JAVA_VERSION = Utils.getJavaVersion();
+
+        @Override
+        public void beforeAll(ExtensionContext extensionContext) throws Exception {
+            cleanUpFromJosmFixture();
+        }
+
         @Override
         public void beforeEach(ExtensionContext context) throws Exception {
-            cleanUpFromJosmFixture();
             // Assume anonymous user
             if (!UserIdentityManager.getInstance().isAnonymous()) {
                 UserIdentityManager.getInstance().setAnonymous();
@@ -69,9 +80,12 @@
                     window.dispose();
                 }
             });
+        }
 
+        @Override
+        public void afterAll(ExtensionContext extensionContext) throws Exception {
             // Parts of JOSM uses weak references - destroy them.
-            System.gc();
+            memoryCleanup();
         }
 
         /**
@@ -83,7 +97,25 @@
             JOSMTestRules.cleanLayerEnvironment();
             Preferences.main().resetToInitialState();
             Preferences.main().enableSaveOnPut(false);
-            System.gc();
+            memoryCleanup();
+        }
+
+        /**
+         * Call {@link System#gc()}
+         * Warning: This is a very expensive method! GC is expensive!
+         * For reference, a test run without gc will take ~7 minutes.
+         * A test run with gc will take 20 minutes (if run before/after each test method) or 10 minutes (if run before/after each test class).
+         * <p>
+         * If you want to do a test run without manual calls to gc, add `-Dtest.without.gc=true` to the arguments.
+         */
+        public static void memoryCleanup() {
+            if (PERFORM_MEMORY_CLEANUP) {
+                System.gc();
+                // Finalization was deprecated in Java 18
+                if (JAVA_VERSION <= 17) {
+                    System.runFinalization();
+                }
+            }
         }
     }
 }
Index: test/unit/org/openstreetmap/josm/testutils/annotations/MapPaintStyles.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/MapPaintStyles.java b/test/unit/org/openstreetmap/josm/testutils/annotations/MapPaintStyles.java
new file mode 100644
--- /dev/null	(date 1696353714178)
+++ b/test/unit/org/openstreetmap/josm/testutils/annotations/MapPaintStyles.java	(date 1696353714178)
@@ -0,0 +1,44 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.testutils.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.openstreetmap.josm.gui.mappaint.ElemStyles;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+/**
+ * Use map styles in tests.
+ *
+ * @author Taylor Smock
+ * @see JOSMTestRules#mapStyles()
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@BasicPreferences
+@ExtendWith(MapPaintStyles.MapPaintStylesExtension.class)
+public @interface MapPaintStyles {
+    class MapPaintStylesExtension implements BeforeEachCallback {
+        private static int lastHashcode;
+
+        @Override
+        public void beforeEach(ExtensionContext extensionContext) throws Exception {
+            setup();
+        }
+
+        public static void setup() {
+            final ElemStyles styles = org.openstreetmap.josm.gui.mappaint.MapPaintStyles.getStyles();
+            if (styles.getStyleSources().hashCode() != lastHashcode || styles.getStyleSources().isEmpty()) {
+                org.openstreetmap.josm.gui.mappaint.MapPaintStyles.readFromPreferences();
+                lastHashcode = org.openstreetmap.josm.gui.mappaint.MapPaintStyles.getStyles().getStyleSources().hashCode();
+            }
+        }
+    }
+}
Index: test/unit/org/openstreetmap/josm/testutils/annotations/ProjectionNadGrids.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/ProjectionNadGrids.java b/test/unit/org/openstreetmap/josm/testutils/annotations/ProjectionNadGrids.java
new file mode 100644
--- /dev/null	(date 1696943628992)
+++ b/test/unit/org/openstreetmap/josm/testutils/annotations/ProjectionNadGrids.java	(date 1696943628992)
@@ -0,0 +1,39 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.testutils.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.nio.file.Paths;
+
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.tools.Utils;
+
+/**
+ * Use NAD projections in tests.
+ *
+ * @author Taylor Smock
+ * @see JOSMTestRules#projectionNadGrids()
+ *
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@ExtendWith(ProjectionNadGrids.NadGridsExtension.class)
+public @interface ProjectionNadGrids {
+    class NadGridsExtension implements BeforeEachCallback {
+        @Override
+        public void beforeEach(ExtensionContext extensionContext) throws Exception {
+            if (Utils.isBlank(Utils.getSystemProperty("PROJ_LIB"))) {
+                Utils.updateSystemProperty("PROJ_LIB", Paths.get("nodist", "data", "projection").toString());
+            }
+            MainApplication.setupNadGridSources();
+        }
+    }
+}
Index: test/unit/org/openstreetmap/josm/testutils/annotations/ResetUniquePrimitiveIdCounters.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/ResetUniquePrimitiveIdCounters.java b/test/unit/org/openstreetmap/josm/testutils/annotations/ResetUniquePrimitiveIdCounters.java
new file mode 100644
--- /dev/null	(date 1696442149190)
+++ b/test/unit/org/openstreetmap/josm/testutils/annotations/ResetUniquePrimitiveIdCounters.java	(date 1696442149190)
@@ -0,0 +1,68 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.testutils.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.platform.commons.function.Try;
+import org.junit.platform.commons.support.ReflectionSupport;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.UniqueIdGenerator;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.spi.preferences.MemoryPreferences;
+
+/**
+ * Reset {@link org.openstreetmap.josm.data.osm.OsmPrimitive} id counters for tests where it makes a difference.
+ * This is most likely an ordering issue with a {@link java.util.Set} collection.
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@Inherited
+@BasicPreferences
+@ExtendWith(ResetUniquePrimitiveIdCounters.Reset.class)
+public @interface ResetUniquePrimitiveIdCounters {
+    class Reset implements BeforeEachCallback {
+        private static AtomicLong[] ID_COUNTERS;
+
+        @Override
+        public void beforeEach(ExtensionContext extensionContext) throws Exception {
+            if (ID_COUNTERS == null) {
+                ID_COUNTERS = getIdCounters();
+            }
+
+            for (AtomicLong counter : ID_COUNTERS) {
+                counter.set(0);
+            }
+        }
+
+        private static AtomicLong[] getIdCounters() throws ReflectiveOperationException {
+            Config.setPreferencesInstance(new MemoryPreferences());
+            List<AtomicLong> idCounters = new ArrayList<>(3);
+            final Field idCounter = UniqueIdGenerator.class.getDeclaredField("idCounter");
+            for (Try<Object> primitive : Arrays.asList(
+                    ReflectionSupport.tryToReadFieldValue(Node.class.getDeclaredField("idGenerator"), null),
+                    ReflectionSupport.tryToReadFieldValue(Way.class.getDeclaredField("idGenerator"), null),
+                    ReflectionSupport.tryToReadFieldValue(Relation.class.getDeclaredField("idGenerator"), null)
+            )) {
+                primitive.andThen(generator -> ReflectionSupport.tryToReadFieldValue(idCounter, generator))
+                        .ifSuccess(counter -> idCounters.add((AtomicLong) counter));
+            }
+            return idCounters.toArray(new AtomicLong[0]);
+        }
+    }
+}
Index: test/unit/org/openstreetmap/josm/testutils/annotations/TaggingPresets.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/TaggingPresets.java b/test/unit/org/openstreetmap/josm/testutils/annotations/TaggingPresets.java
new file mode 100644
--- /dev/null	(date 1696351156392)
+++ b/test/unit/org/openstreetmap/josm/testutils/annotations/TaggingPresets.java	(date 1696351156392)
@@ -0,0 +1,49 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.testutils.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.Collection;
+
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+/**
+ * Use presets in tests.
+ *
+ * @author Taylor Smock
+ * @see JOSMTestRules#presets()
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@BasicPreferences
+@ExtendWith(TaggingPresets.TaggingPresetsExtension.class)
+public @interface TaggingPresets {
+
+    class TaggingPresetsExtension implements BeforeEachCallback {
+        private static int expectedHashcode = 0;
+
+        @Override
+        public void beforeEach(ExtensionContext extensionContext) {
+            setup();
+        }
+
+        /**
+         * Setup the tagging presets
+         */
+        public static synchronized void setup() {
+            final Collection<TaggingPreset> oldPresets = org.openstreetmap.josm.gui.tagging.presets.TaggingPresets.getTaggingPresets();
+            if (oldPresets.isEmpty() || expectedHashcode != oldPresets.hashCode()) {
+                org.openstreetmap.josm.gui.tagging.presets.TaggingPresets.readFromPreferences();
+                expectedHashcode = org.openstreetmap.josm.gui.tagging.presets.TaggingPresets.getTaggingPresets().hashCode();
+            }
+        }
+    }
+}
Index: test/unit/org/openstreetmap/josm/testutils/annotations/Territories.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/Territories.java b/test/unit/org/openstreetmap/josm/testutils/annotations/Territories.java
--- a/test/unit/org/openstreetmap/josm/testutils/annotations/Territories.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/testutils/annotations/Territories.java	(date 1696419257062)
@@ -3,6 +3,7 @@
 
 import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
@@ -27,6 +28,7 @@
 @Target({ElementType.TYPE, ElementType.METHOD})
 @BasicPreferences // Needed for nodes
 @Projection // Needed for getEastNorth
+@Inherited
 @ExtendWith(Territories.TerritoriesExtension.class)
 public @interface Territories {
     /**
@@ -62,27 +64,35 @@
         private static Initialize last = Initialize.NONE;
 
         @Override
-        public void beforeAll(ExtensionContext context) throws Exception {
+        public void beforeAll(ExtensionContext context) {
             this.beforeEach(context);
         }
 
         @Override
-        public void beforeEach(ExtensionContext context) throws Exception {
+        public void beforeEach(ExtensionContext context) {
             Optional<Territories> annotation = AnnotationSupport.findAnnotation(context.getElement(),
                     Territories.class);
             if (annotation.isPresent()) {
                 Initialize current = annotation.get().value();
-                if (current.ordinal() <= last.ordinal()) {
-                    return;
-                }
-                last = current;
-                // Avoid potential race conditions if tests are parallelized
-                synchronized (TerritoriesExtension.class) {
-                    if (current == Initialize.INTERNAL) {
-                        org.openstreetmap.josm.tools.Territories.initializeInternalData();
-                    } else if (current == Initialize.ALL) {
-                        org.openstreetmap.josm.tools.Territories.initialize();
-                    }
+                setup(current);
+            }
+        }
+
+        /**
+         * Set up the test
+         * @param current The current level to initialize {@link org.openstreetmap.josm.tools.Territories} to
+         */
+        public static void setup(Initialize current) {
+            if (current.ordinal() <= last.ordinal()) {
+                return;
+            }
+            last = current;
+            // Avoid potential race conditions if tests are parallelized
+            synchronized (TerritoriesExtension.class) {
+                if (current == Initialize.INTERNAL) {
+                    org.openstreetmap.josm.tools.Territories.initializeInternalData();
+                } else if (current == Initialize.ALL) {
+                    org.openstreetmap.josm.tools.Territories.initialize();
                 }
             }
         }
Index: test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java b/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
--- a/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(date 1696432925220)
@@ -23,11 +23,12 @@
 import java.util.Arrays;
 import java.util.Map;
 import java.util.TimeZone;
+import java.util.concurrent.TimeUnit;
 import java.util.logging.Handler;
 import java.util.logging.Level;
 
-import mockit.internal.state.SavePoint;
 import org.awaitility.Awaitility;
+import org.awaitility.Durations;
 import org.junit.jupiter.api.extension.AfterAllCallback;
 import org.junit.jupiter.api.extension.AfterEachCallback;
 import org.junit.jupiter.api.extension.BeforeAllCallback;
@@ -53,10 +54,8 @@
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
 import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
 import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreferenceTestIT;
-import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.CertificateAmendment;
 import org.openstreetmap.josm.io.OsmApi;
@@ -65,6 +64,10 @@
 import org.openstreetmap.josm.io.OsmTransferCanceledException;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.spi.preferences.Setting;
+import org.openstreetmap.josm.testutils.annotations.JosmDefaults;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
+import org.openstreetmap.josm.testutils.annotations.TaggingPresets;
+import org.openstreetmap.josm.testutils.annotations.Territories;
 import org.openstreetmap.josm.testutils.mockers.EDTAssertionMocker;
 import org.openstreetmap.josm.testutils.mockers.WindowlessMapViewStateMocker;
 import org.openstreetmap.josm.testutils.mockers.WindowlessNavigatableComponentMocker;
@@ -75,12 +78,12 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MemoryManagerTest;
 import org.openstreetmap.josm.tools.PlatformManager;
-import org.openstreetmap.josm.tools.Territories;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.bugreport.ReportedException;
 import org.openstreetmap.josm.tools.date.DateUtils;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import mockit.internal.state.SavePoint;
 
 /**
  * This class runs a test in an environment that resembles the one used by the JOSM main application.
@@ -590,16 +593,16 @@
 
         if (useMapStyles) {
             // Reset the map paint styles.
-            MapPaintStyles.readFromPreferences();
+            MapPaintStyles.MapPaintStylesExtension.setup();
         }
 
         if (usePresets) {
             // Reset the presets.
-            TaggingPresets.readFromPreferences();
+            TaggingPresets.TaggingPresetsExtension.setup();
         }
 
         if (territories) {
-            Territories.initializeInternalData();
+            Territories.TerritoriesExtension.setup(Territories.Initialize.INTERNAL);
         }
 
         if (this.edtAssertionMockingRunnable != null) {
@@ -631,6 +634,7 @@
     }
 
     private void workaroundJdkBug8159956() {
+        // Note: This has been backported to Java 8u381 (2023-07-18)
         try {
             if (PlatformManager.isPlatformWindows() && Utils.getJavaVersion() == 8 && GraphicsEnvironment.isHeadless()) {
                 // https://bugs.openjdk.java.net/browse/JDK-8159956
@@ -651,7 +655,7 @@
         MemoryManagerTest.resetState(true);
         cleanLayerEnvironment();
         Preferences.main().resetToInitialState();
-        System.gc();
+        JosmDefaults.DefaultsExtension.memoryCleanup();
     }
 
     /**
@@ -688,7 +692,8 @@
         // Sync worker thread
         final boolean[] queueEmpty = {false};
         MainApplication.worker.submit(() -> queueEmpty[0] = true);
-        Awaitility.await().forever().until(() -> queueEmpty[0]);
+        // Default pollInterval is 100ms, which means that each test takes (at minimum) .1s.
+        Awaitility.await().pollDelay(0, TimeUnit.SECONDS).pollInterval(Durations.ONE_MILLISECOND).forever().until(() -> queueEmpty[0]);
         // Remove all layers
         cleanLayerEnvironment();
         MemoryManagerTest.resetState(allowMemoryManagerLeaks);
@@ -717,7 +722,7 @@
         });
 
         // Parts of JOSM uses weak references - destroy them.
-        System.gc();
+        JosmDefaults.DefaultsExtension.memoryCleanup();
     }
 
     private final class CreateJosmEnvironment extends Statement {
Index: test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java b/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
--- a/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java	(date 1696419257069)
@@ -16,30 +16,22 @@
 import java.util.TimeZone;
 import java.util.concurrent.ForkJoinPool;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import net.trajano.commons.testing.UtilityClassTestUtil;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.I18n;
 import org.openstreetmap.josm.tools.UncheckedParseException;
 
+import net.trajano.commons.testing.UtilityClassTestUtil;
+
 /**
  * Unit tests of {@link DateUtils} class.
  */
+@BasicPreferences
+@I18n
 public class DateUtilsTest {
-
-    /**
-     * Set the timezone and timeout.
-     * <p>
-     * Timeouts need to be disabled because we change the time zone.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().i18n().preferences();
-
     /**
      * Tests that {@code DateUtils} satisfies utility class criteria.
      * @throws ReflectiveOperationException if an error occurs
Index: test/unit/org/openstreetmap/josm/tools/date/IntervalTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/tools/date/IntervalTest.java b/test/unit/org/openstreetmap/josm/tools/date/IntervalTest.java
--- a/test/unit/org/openstreetmap/josm/tools/date/IntervalTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/tools/date/IntervalTest.java	(date 1696419257070)
@@ -1,26 +1,17 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.tools.date;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.time.Instant;
 import java.util.Locale;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
+@BasicPreferences
 class IntervalTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
-
     /**
      * Setup test.
      */
Index: test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java b/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java
--- a/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java	(date 1696419257064)
@@ -12,7 +12,6 @@
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.io.ChangesetClosedException;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.MissingOAuthAccessTokenException;
@@ -21,24 +20,16 @@
 import org.openstreetmap.josm.io.OsmApiException;
 import org.openstreetmap.josm.io.OsmApiInitializationException;
 import org.openstreetmap.josm.io.auth.CredentialsManager;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 import org.openstreetmap.josm.tools.date.DateUtils;
 import org.openstreetmap.josm.tools.date.DateUtilsTest;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link ExceptionUtil} class.
  */
+@BasicPreferences
+@org.openstreetmap.josm.testutils.annotations.OsmApi(org.openstreetmap.josm.testutils.annotations.OsmApi.APIType.FAKE)
 class ExceptionUtilTest {
-
-    /**
-     * Setup rule.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI();
-
     private static String baseUrl;
     private static String serverUrl;
     private static String host;
Index: test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java b/test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java
--- a/test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java	(date 1696419257065)
@@ -9,24 +9,14 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.I18n;
 
 /**
  * Unit tests of {@link LanguageInfo}.
  */
+@I18n("ca@valencia")
 class LanguageInfoTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().i18n("ca@valencia");
-
     private static final Locale EN_NZ = new Locale("en", "NZ");
     private static final Locale DE_DE = Locale.GERMANY;
     private static final Locale PT_BR = new Locale("pt", "BR");
Index: test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java b/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java
--- a/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java	(date 1696419257066)
@@ -10,39 +10,20 @@
 
 import javax.swing.ImageIcon;
 
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmUtils;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetsTest;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.MapPaintStyles;
 import org.openstreetmap.josm.tools.OsmPrimitiveImageProvider.Options;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 /**
  * Unit tests of {@link OsmPrimitiveImageProvider}
  */
+@MapPaintStyles
+@org.openstreetmap.josm.testutils.annotations.TaggingPresets
 class OsmPrimitiveImageProviderTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().mapStyles().presets();
-
-    /**
-     * Setup test.
-     */
-    @BeforeAll
-    public static void setUp() {
-        JOSMFixture.createUnitTestFixture().init();
-    }
-
     /**
      * Unit test of {@link OsmPrimitiveImageProvider#getResource}.
      */
Index: test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java b/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java
--- a/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java	(revision 18861)
+++ b/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java	(date 1696419257067)
@@ -7,24 +7,13 @@
 import java.util.Collections;
 
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Integration tests of {@link Territories} class.
  */
+@Projection
 class TerritoriesTestIT {
-
-    /**
-     * Test rules.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rules = new JOSMTestRules().projection();
-
-
     /**
      * Test of {@link Territories#initialize} method.
      */
