Index: test/unit/net/simon04/comfort0/EditLevel0LActionTest.java
===================================================================
--- test/unit/net/simon04/comfort0/EditLevel0LActionTest.java	(revision 35895)
+++ test/unit/net/simon04/comfort0/EditLevel0LActionTest.java	(working copy)
@@ -10,8 +10,8 @@
 import java.io.StringReader;
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
 import org.openstreetmap.josm.command.MoveCommand;
 import org.openstreetmap.josm.command.PseudoCommand;
@@ -27,15 +27,17 @@
 
 import net.simon04.comfort0.level0l.parsergen.Level0LParser;
 import net.simon04.comfort0.level0l.parsergen.ParseException;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
-public class EditLevel0LActionTest {
+@BasicPreferences
+class EditLevel0LActionTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
+    JOSMTestRules test = new JOSMTestRules().projection();
 
     private SequenceCommand buildChangeCommands(DataSet dataSet) throws ParseException {
         final String level0l = "node 1831881213: 54.0900666, 12.2539381 #Neu Broderstorf (54.0900666, 12.2539381)\n" +
@@ -54,7 +56,7 @@
     }
 
     @Test
-    public void test() throws Exception {
+    void test() throws Exception {
         final Node node = new Node(1831881213, 42);
         node.setCoor(new LatLon(54.0900666, 12.2539381));
         final DataSet dataSet = new DataSet(node);
Index: test/unit/net/simon04/comfort0/OsmToLevel0LTest.java
===================================================================
--- test/unit/net/simon04/comfort0/OsmToLevel0LTest.java	(revision 35895)
+++ test/unit/net/simon04/comfort0/OsmToLevel0LTest.java	(working copy)
@@ -1,37 +1,29 @@
 package net.simon04.comfort0;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.InputStream;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.openstreetmap.josm.data.Preferences;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 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.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
-public class OsmToLevel0LTest {
+import java.io.InputStream;
 
-    /**
-     * Setup rule
-     */
-    @Rule
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
 
-    @Before
-    public void setUp() throws Exception {
-        Preferences.main().putBoolean("osm-primitives.showcoor", true);
+@BasicPreferences
+class OsmToLevel0LTest {
+
+    @BeforeEach
+    public void setUp() {
+        Config.getPref().putBoolean("osm-primitives.showcoor", true);
     }
 
     @Test
-    public void testNode() throws Exception {
+    void testNode() {
         final Node node = new Node(1234L, 42);
         node.setCoor(new LatLon(123.45, 67.89));
         node.put("name", "Comfort0");
@@ -43,7 +35,7 @@
     }
 
     @Test
-    public void testLargerExample() throws Exception {
+    void testLargerExample() throws Exception {
         // from https://wiki.openstreetmap.org/wiki/OSM_XML#OSM_XML_file_format
         // compare to https://wiki.openstreetmap.org/wiki/Level0L#Examples
         try (InputStream in = getClass().getClassLoader().getResource("example.osm").openStream()) {
Index: test/unit/net/simon04/comfort0/level0l/parsergen/Level0LParserTest.java
===================================================================
--- test/unit/net/simon04/comfort0/level0l/parsergen/Level0LParserTest.java	(revision 35895)
+++ test/unit/net/simon04/comfort0/level0l/parsergen/Level0LParserTest.java	(working copy)
@@ -2,14 +2,13 @@
 
 import static org.CustomMatchers.hasSize;
 import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
 
 import java.io.StringReader;
 import java.util.List;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.NodeData;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.PrimitiveData;
@@ -16,18 +15,12 @@
 import org.openstreetmap.josm.data.osm.RelationData;
 import org.openstreetmap.josm.data.osm.WayData;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
-public class Level0LParserTest {
-
-    /**
-     * Setup rule
-     */
-    @Rule
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences();
-
+@BasicPreferences
+class Level0LParserTest {
     @Test
-    public void testNode() throws Exception {
+    void testNode() throws Exception {
         final String level0l = "" +
                 "node 298884272: 54.0901447, 12.2516513\n" +
                 "  name = Neu Broderstorf\n" +
@@ -42,7 +35,7 @@
     }
 
     @Test
-    public void testWay() throws Exception {
+    void testWay() throws Exception {
         final String level0l = "" +
                 "way 26659127\n" +
                 "  nd 292403538\n" +
@@ -62,7 +55,7 @@
     }
 
     @Test
-    public void testRelation() throws Exception {
+    void testRelation() throws Exception {
         final String level0l = "" +
                 "relation 56688 # member types: nd, wy, rel; roles are put after ids\n" +
                 "  nd 294942404\n" +
@@ -89,7 +82,7 @@
     }
 
     @Test
-    public void testExampleFromDocs() throws Exception {
+    void testExampleFromDocs() throws Exception {
         // https://wiki.openstreetmap.org/wiki/Level0L#Examples
         final String level0l = "" +
                 "node 298884269: 54.0901746, 12.2482632 # made by user SvenHRO (46882) in changeset 676636 on 2008-09-21T21:37:45Z\n" +
