Index: trunk/test/unit/org/CustomMatchers.java
===================================================================
--- trunk/test/unit/org/CustomMatchers.java	(revision 17269)
+++ trunk/test/unit/org/CustomMatchers.java	(revision 17275)
@@ -12,5 +12,5 @@
 import org.hamcrest.Matcher;
 import org.hamcrest.TypeSafeMatcher;
-import org.junit.Ignore;
+import org.junit.jupiter.api.Disabled;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -20,5 +20,5 @@
  * Custom matchers for unit tests.
  */
-@Ignore("no test")
+@Disabled("no test")
 public final class CustomMatchers {
 
Index: trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm;
 
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.File;
Index: trunk/test/unit/org/openstreetmap/josm/TestUtils.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/TestUtils.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/TestUtils.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 import java.awt.Component;
@@ -34,6 +35,5 @@
 import java.util.stream.Stream;
 
-import org.junit.Assert;
-import org.junit.Assume;
+import org.junit.jupiter.api.Assertions;
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -447,4 +447,5 @@
      * Use to assume that EqualsVerifier is working with the current JVM.
      */
+    @SuppressWarnings("null")
     public static void assumeWorkingEqualsVerifier() {
         if (Utils.getJavaVersion() >= 16) {
@@ -457,5 +458,5 @@
             nl.jqno.equalsverifier.internal.lib.bytebuddy.ClassFileVersion.ofThisVm();
         } catch (IllegalArgumentException e) {
-            Assume.assumeNoException(e);
+            assumeFalse(e != null);
         }
     }
@@ -464,4 +465,5 @@
      * Use to assume that JMockit is working with the current JVM.
      */
+    @SuppressWarnings("null")
     public static void assumeWorkingJMockit() {
         try {
@@ -471,5 +473,5 @@
             new JOptionPaneSimpleMocker();
         } catch (UnsupportedOperationException e) {
-            Assume.assumeNoException(e);
+            assumeFalse(e != null);
         } finally {
             TestRunnerDecorator.cleanUpAllMocks();
@@ -546,5 +548,5 @@
     /**
      * Replaces {@linkplain System#lineSeparator() system dependent line separators} with {@code \n}
-     * and calls {@link Assert#assertEquals(java.lang.Object, java.lang.Object)}.
+     * and calls {@link Assertions#assertEquals(java.lang.Object, java.lang.Object)}.
      * @param expected expected value
      * @param actual the value to check against <code>expected</code>
Index: trunk/test/unit/org/openstreetmap/josm/actions/AboutActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/AboutActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/AboutActionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests for class {@link AboutAction}.
  */
-public final class AboutActionTest {
+final class AboutActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testBuildAboutPanel() {
+    void testBuildAboutPanel() {
         assertNotNull(new AboutAction().buildAboutPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java	(revision 17275)
@@ -2,11 +2,12 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -24,10 +25,10 @@
  * Unit tests for class {@link AlignInLineAction}.
  */
-public final class AlignInLineActionTest {
+final class AlignInLineActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -39,5 +40,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         // Enable "Align in line" feature.
@@ -54,5 +55,5 @@
      */
     @Test
-    public void testNodesOpenWay() throws InvalidSelection {
+    void testNodesOpenWay() throws InvalidSelection {
         DataSet dataSet = new DataSet();
 
@@ -86,5 +87,5 @@
      */
     @Test
-    public void testNodesClosedWay() throws InvalidSelection {
+    void testNodesClosedWay() throws InvalidSelection {
         DataSet dataSet = new DataSet();
 
@@ -119,5 +120,5 @@
      */
     @Test
-    public void testNodesOpenWays() throws InvalidSelection {
+    void testNodesOpenWays() throws InvalidSelection {
         DataSet dataSet = new DataSet();
 
@@ -153,5 +154,5 @@
      */
     @Test
-    public void testSimpleWay() throws InvalidSelection {
+    void testSimpleWay() throws InvalidSelection {
         DataSet dataSet = new DataSet();
 
@@ -200,6 +201,6 @@
     private void assertCoordEq(Node node, double x, double y) {
         EastNorth coordinate = node.getEastNorth();
-        assertEquals("Wrong x coordinate.", x, coordinate.getX(), LatLon.MAX_SERVER_PRECISION);
-        assertEquals("Wrong y coordinate.", y, coordinate.getY(), LatLon.MAX_SERVER_PRECISION);
+        assertEquals(x, coordinate.getX(), LatLon.MAX_SERVER_PRECISION, "Wrong x coordinate.");
+        assertEquals(y, coordinate.getY(), LatLon.MAX_SERVER_PRECISION, "Wrong y coordinate.");
     }
 
@@ -209,5 +210,5 @@
      */
     @Test
-    public void testLineDifferentCoordinates() throws InvalidSelection {
+    void testLineDifferentCoordinates() throws InvalidSelection {
         assertNotNull(new Line(new Node(new EastNorth(0, 1)),
                                new Node(new EastNorth(0, 2))));
@@ -222,8 +223,8 @@
      * @throws InvalidSelection always
      */
-    @Test(expected = InvalidSelection.class)
-    public void testLineSameCoordinates1() throws InvalidSelection {
-        new Line(new Node(new EastNorth(0, 1)),
-                 new Node(new EastNorth(0, 1)));
+    @Test
+    void testLineSameCoordinates1() throws InvalidSelection {
+        assertThrows(InvalidSelection.class, () -> new Line(new Node(new EastNorth(0, 1)),
+                 new Node(new EastNorth(0, 1))));
     }
 
@@ -232,8 +233,8 @@
      * @throws InvalidSelection always
      */
-    @Test(expected = InvalidSelection.class)
-    public void testLineSameCoordinates2() throws InvalidSelection {
-        new Line(new Node(new EastNorth(0, 1)),
-                 new Node(new EastNorth(0+1e-175, 1+1e-175)));
+    @Test
+    void testLineSameCoordinates2() throws InvalidSelection {
+        assertThrows(InvalidSelection.class, () -> new Line(new Node(new EastNorth(0, 1)),
+                 new Node(new EastNorth(0+1e-175, 1+1e-175))));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/CombineWayActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
 import java.io.IOException;
@@ -15,6 +15,6 @@
 import java.util.Set;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -32,10 +32,10 @@
  * Unit tests for class {@link CombineWayAction}.
  */
-public class CombineWayActionTest {
+class CombineWayActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testTicket11957() throws IOException, IllegalDataException {
+    void testTicket11957() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(11957, "data.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testTicket18385() throws IOException, IllegalDataException {
+    void testTicket18385() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18385, "data.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testTicket18387() throws IOException, IllegalDataException {
+    void testTicket18387() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18387, "data.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -104,5 +104,5 @@
      */
     @Test
-    public void testTicket18367() throws IOException, IllegalDataException {
+    void testTicket18367() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18367, "nocombine.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -125,5 +125,5 @@
      */
     @Test
-    public void testTicket18367NeedsSplit() throws IOException, IllegalDataException {
+    void testTicket18367NeedsSplit() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18367, "split-and-reverse.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -149,5 +149,5 @@
      */
     @Test
-    public void testDetectReversedWays() throws IOException, IllegalDataException {
+    void testDetectReversedWays() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18367, "silent-revert.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -175,5 +175,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(NodePair.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.awt.datatransfer.Clipboard;
@@ -15,6 +15,6 @@
 import java.util.Arrays;
 
-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.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -32,5 +32,5 @@
  * Unit tests for class {@link CopyAction}.
  */
-public class CopyActionTest {
+class CopyActionTest {
     private static final class CapturingCopyAction extends CopyAction {
         private boolean warningShown;
@@ -45,5 +45,5 @@
      * We need prefs for this.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI();
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testWarnOnEmpty() throws UnsupportedFlavorException, IOException {
+    void testWarnOnEmpty() throws UnsupportedFlavorException, IOException {
         Clipboard clipboard = ClipboardUtils.getClipboard();
         clipboard.setContents(new StringSelection("test"), null);
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testCopySinglePrimitive() throws Exception {
+    void testCopySinglePrimitive() throws Exception {
         DataSet data = new DataSet();
 
Index: trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.lang.reflect.Field;
@@ -9,6 +9,6 @@
 import java.util.Collection;
 
-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.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -29,10 +29,10 @@
  * Unit tests for class {@link CreateCircleAction}.
  */
-public final class CreateCircleActionTest {
+final class CreateCircleActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -45,5 +45,5 @@
      */
     @Test
-    public void testTicket7421case0() throws ReflectiveOperationException {
+    void testTicket7421case0() throws ReflectiveOperationException {
         DataSet dataSet = new DataSet();
 
@@ -65,11 +65,8 @@
         // Expected result: Dataset contain one closed way, clockwise
         Collection<Way> resultingWays = dataSet.getWays();
-        assertSame(String.format("Expect one way after perform action. %d found", resultingWays.size()),
-                   resultingWays.size(), 1);
+        assertSame(1, resultingWays.size(), String.format("Expect one way after perform action. %d found", resultingWays.size()));
         Way resultingWay = resultingWays.iterator().next();
-        assertTrue("Resulting way is not closed",
-                   resultingWay.isClosed());
-        assertTrue("Found anti-clockwize circle while way was clockwize",
-                   Geometry.isClockwise(resultingWay));
+        assertTrue(resultingWay.isClosed(), "Resulting way is not closed");
+        assertTrue(Geometry.isClockwise(resultingWay), "Found anti-clockwise circle while way was clockwise");
     }
 
@@ -102,5 +99,5 @@
      */
     @Test
-    public void testTicket7421case1() throws ReflectiveOperationException {
+    void testTicket7421case1() throws ReflectiveOperationException {
         DataSet dataSet = new DataSet();
 
@@ -127,11 +124,8 @@
             // Expected result: Dataset contain one closed way, clockwise
             Collection<Way> resultingWays = dataSet.getWays();
-            assertSame(String.format("Expect one way after perform action. %d found", resultingWays.size()),
-                       resultingWays.size(), 1);
+            assertSame(1, resultingWays.size(), String.format("Expect one way after perform action. %d found", resultingWays.size()));
             Way resultingWay = resultingWays.iterator().next();
-            assertTrue("Resulting way is not closed",
-                       resultingWay.isClosed());
-            assertTrue("Found anti-clockwise way while traffic is left hand.",
-                       Geometry.isClockwise(resultingWay));
+            assertTrue(resultingWay.isClosed(), "Resulting way is not closed");
+            assertTrue(Geometry.isClockwise(resultingWay), "Found anti-clockwise way while traffic is left hand.");
         } finally {
             // Restore left/right hand traffic database
Index: trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.nio.file.Files;
@@ -12,6 +12,6 @@
 import java.util.TreeMap;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.SequenceCommand;
@@ -37,10 +37,10 @@
  * Unit test of {@link CreateMultipolygonAction}
  */
-public class CreateMultipolygonActionTest {
+class CreateMultipolygonActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().main().preferences();
@@ -80,5 +80,5 @@
 
     @Test
-    public void testCreate1() throws Exception {
+    void testCreate1() throws Exception {
         DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm")), null);
         Pair<SequenceCommand, Relation> mp = CreateMultipolygonAction.createMultipolygonCommand(ds.getWays(), null);
@@ -88,5 +88,5 @@
 
     @Test
-    public void testCreate2() throws Exception {
+    void testCreate2() throws Exception {
         DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm")), null);
         Relation mp = createMultipolygon(ds.getWays(), "ref=1 OR ref:1.1.", null, true);
@@ -95,5 +95,5 @@
 
     @Test
-    public void testUpdate1() throws Exception {
+    void testUpdate1() throws Exception {
         DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm")), null);
         Relation mp = createMultipolygon(ds.getWays(), "ref=\".*1$\"", null, true);
@@ -106,5 +106,5 @@
 
     @Test
-    public void testUpdate2() throws Exception {
+    void testUpdate2() throws Exception {
         DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm")), null);
         Relation mp = createMultipolygon(ds.getWays(), "ref=1 OR ref:1.1.1", null, true);
@@ -119,5 +119,5 @@
      */
     @Test
-    public void testTicket17767() throws Exception {
+    void testTicket17767() throws Exception {
         DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(17767, "upd-mp.osm"), null);
         Layer layer = new OsmDataLayer(ds, null, null);
@@ -141,5 +141,5 @@
      */
     @Test
-    public void testTicket17768() throws Exception {
+    void testTicket17768() throws Exception {
         DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(17768, "dupmem.osm"), null);
         Layer layer = new OsmDataLayer(ds, null, null);
Index: trunk/test/unit/org/openstreetmap/josm/actions/DeleteLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/DeleteLayerActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/DeleteLayerActionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -17,10 +17,10 @@
  * Unit tests for class {@link DeleteLayerAction}.
  */
-public final class DeleteLayerActionTest {
+final class DeleteLayerActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testActionPerformed() {
+    void testActionPerformed() {
         DeleteLayerAction action = new DeleteLayerAction();
         // No layer
Index: trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.junit.contrib.java.lang.system.ExpectedSystemExit;
 import org.openstreetmap.josm.TestUtils;
@@ -22,10 +22,10 @@
  * Unit tests for class {@link ExitAction}.
  */
-public final class ExitActionTest {
+final class ExitActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -34,5 +34,5 @@
      * System.exit rule
      */
-    @Rule
+    @RegisterExtension
     public final ExpectedSystemExit exit = ExpectedSystemExit.none();
 
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testActionPerformed() {
+    void testActionPerformed() {
         TestUtils.assumeWorkingJMockit();
         exit.expectSystemExitWithStatus(0);
Index: trunk/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -9,6 +9,6 @@
 import javax.swing.JPanel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.actions.ExpertToggleAction.ExpertModeChangeListener;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -21,9 +21,9 @@
  * @since 11224
  */
-public class ExpertToggleActionTest {
+class ExpertToggleActionTest {
     /**
      * We need prefs to store expert mode state.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testVisibilitySwitcher() {
+    void testVisibilitySwitcher() {
         ExpertToggleAction.getInstance().setExpert(false);
         JPanel c = new JPanel();
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testExpertModeListener() {
+    void testExpertModeListener() {
         AtomicBoolean value = new AtomicBoolean(false);
         ExpertToggleAction.getInstance().setExpert(true);
Index: trunk/test/unit/org/openstreetmap/josm/actions/ExtensionFileFilterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/ExtensionFileFilterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/ExtensionFileFilterTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.ExtensionFileFilter.AddArchiveExtension;
@@ -13,5 +13,5 @@
  * Unit tests for class {@link ExtensionFileFilter}.
  */
-public class ExtensionFileFilterTest {
+class ExtensionFileFilterTest {
 
     private static void test(String extensions, String defaultExtension, String description, boolean addArchiveExtensionsToDescription,
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testNewFilterWithArchiveExtensions() {
+    void testNewFilterWithArchiveExtensions() {
         test("ext1", "ext1", "description", true,
                 "ext1,ext1.gz,ext1.bz,ext1.bz2,ext1.xz,ext1.zip",
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ExtensionFileFilter.class).usingGetClass()
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testEnumAddArchiveExtension() {
+    void testEnumAddArchiveExtension() {
         TestUtils.superficialEnumCodeCoverage(AddArchiveExtension.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -11,9 +11,9 @@
  * Test {@link FullscreenToggleAction}
  */
-public class FullscreenToggleActionTest {
+class FullscreenToggleActionTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -23,5 +23,5 @@
      */
     @Test
-    public void testFullscreenToggleAction() {
+    void testFullscreenToggleAction() {
         FullscreenToggleAction action = new FullscreenToggleAction();
         // Cannot really test it in headless mode, but at least check we can toggle the action without error
Index: trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -15,6 +15,6 @@
 import java.util.Set;
 
-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.TestUtils;
 import org.openstreetmap.josm.actions.search.SearchAction;
@@ -44,10 +44,10 @@
  * Unit tests of {@link JoinAreasAction} class.
  */
-public class JoinAreasActionTest {
+class JoinAreasActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection().preferences();
@@ -59,5 +59,5 @@
      */
     @Test
-    public void testTicket9599() throws IOException, IllegalDataException {
+    void testTicket9599() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(9599, "ex5.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testTicket9599Simple() throws IOException, IllegalDataException {
+    void testTicket9599Simple() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(9599, "three_old.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -106,5 +106,5 @@
      */
     @Test
-    public void testTicket10511() throws IOException, IllegalDataException {
+    void testTicket10511() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(10511, "10511_mini.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -128,5 +128,5 @@
      */
     @Test
-    public void testTicket11992() throws IOException, IllegalDataException {
+    void testTicket11992() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(11992, "shapes.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -154,5 +154,5 @@
      */
     @Test
-    public void testTicket18744() throws IOException, IllegalDataException {
+    void testTicket18744() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18744, "18744-sample.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -179,5 +179,5 @@
     @Test
     @SuppressWarnings({ "rawtypes", "unchecked" })
-    public void testExamples() throws Exception {
+    void testExamples() throws Exception {
         DataSet dsToJoin, dsExpected;
         try (InputStream is = Files.newInputStream(Paths.get("nodist/data/Join_Areas_Tests.osm"))) {
@@ -199,14 +199,14 @@
             Collection<OsmPrimitive> primitives = tests.get(test);
             for (OsmPrimitive osm : primitives) {
-                assertTrue(test + "; expected way, but got: " + osm, osm instanceof Way);
+                assertTrue(osm instanceof Way, test + "; expected way, but got: " + osm);
             }
             new JoinAreasAction(false).join((Collection) primitives);
             Collection<OsmPrimitive> joinedCol = dsToJoin.getPrimitives(osm -> !osm.isDeleted() && Objects.equals(osm.get("test"), test));
-            assertEquals("in test " + test + ":", 1, joinedCol.size());
+            assertEquals(1, joinedCol.size(), "in test " + test + ":");
             Collection<OsmPrimitive> expectedCol = dsExpected.getPrimitives(osm -> !osm.isDeleted() && Objects.equals(osm.get("test"), test));
-            assertEquals("in test " + test + ":", 1, expectedCol.size());
+            assertEquals(1, expectedCol.size(), "in test " + test + ":");
             OsmPrimitive osmJoined = joinedCol.iterator().next();
             OsmPrimitive osmExpected = expectedCol.iterator().next();
-            assertTrue("difference in test " + test, isSemanticallyEqual(osmExpected, osmJoined));
+            assertTrue(isSemanticallyEqual(osmExpected, osmJoined), "difference in test " + test);
         }
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/JoinNodeWayActionTest.java	(revision 17275)
@@ -2,5 +2,7 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.Rectangle;
@@ -10,6 +12,6 @@
 import java.util.stream.Collectors;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -33,9 +35,9 @@
  * Unit tests for class {@link JoinNodeWayAction}.
  */
-public final class JoinNodeWayActionTest {
+final class JoinNodeWayActionTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().main().preferences();
@@ -61,5 +63,5 @@
      */
     @Test
-    public void testTicket18189() throws Exception {
+    void testTicket18189() throws Exception {
         DataSet dataSet = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
@@ -93,7 +95,7 @@
             action.actionPerformed(null);
             // Make sure the node was only moved once
-            assertTrue("Node n5 wasn't added to way w1.", w1.containsNode(n5));
-            assertTrue("Node n5 wasn't added to way w2.", w2.containsNode(n5));
-            assertTrue("Node was moved to an unexpected position", n5.getEastNorth().equalsEpsilon(expected, 1e-7));
+            assertTrue(w1.containsNode(n5), "Node n5 wasn't added to way w1.");
+            assertTrue(w2.containsNode(n5), "Node n5 wasn't added to way w2.");
+            assertTrue(n5.getEastNorth().equalsEpsilon(expected, 1e-7), "Node was moved to an unexpected position");
         } finally {
             MainApplication.getLayerManager().removeLayer(layer);
@@ -106,5 +108,5 @@
      */
     @Test
-    public void testTicket11508() throws Exception {
+    void testTicket11508() throws Exception {
         DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(11508, "11508_example.osm"), null);
         Layer layer = new OsmDataLayer(ds, OsmDataLayer.createNewName(), null);
@@ -113,5 +115,5 @@
             List<Node> nodesToMove = ds.getNodes().stream().filter(n -> n.hasTag("name", "select me and press N"))
                     .collect(Collectors.toList());
-            assertTrue(nodesToMove.size() == 1);
+            assertEquals(1, nodesToMove.size());
             Node toMove = nodesToMove.iterator().next();
             Node expected = new Node(new LatLon(47.56331849690742, 8.800789259499311));
@@ -122,6 +124,6 @@
             action.actionPerformed(null);
 
-            assertTrue("Node was moved to an unexpected position", toMove.getEastNorth().equalsEpsilon(expected.getEastNorth(), 1e-7));
-            assertTrue("Node was not added to expected number of ways", toMove.getParentWays().size() == 2);
+            assertTrue(toMove.getEastNorth().equalsEpsilon(expected.getEastNorth(), 1e-7), "Node was moved to an unexpected position");
+            assertEquals(2, toMove.getParentWays().size(), "Node was not added to expected number of ways");
         } finally {
             MainApplication.getLayerManager().removeLayer(layer);
@@ -134,5 +136,5 @@
      */
     @Test
-    public void testTicket18189Crossing() throws Exception {
+    void testTicket18189Crossing() throws Exception {
         DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(18189, "moveontocrossing.osm"), null);
         Layer layer = new OsmDataLayer(ds, OsmDataLayer.createNewName(), null);
@@ -144,5 +146,5 @@
             List<Node> nodesToMove = ds.getNodes().stream().filter(n -> n.hasTag("name", "select me and press N"))
                     .collect(Collectors.toList());
-            assertTrue(nodesToMove.size() == 1);
+            assertEquals(1, nodesToMove.size());
             Node toMove = nodesToMove.iterator().next();
             ds.setSelected(toMove);
@@ -159,5 +161,5 @@
      */
     @Test
-    public void testTicket18189ThreeWays() throws Exception {
+    void testTicket18189ThreeWays() throws Exception {
         DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(18189, "data.osm"), null);
         Layer layer = new OsmDataLayer(ds, OsmDataLayer.createNewName(), null);
@@ -169,12 +171,11 @@
             List<Node> nodesToMove = ds.getNodes().stream().filter(n -> n.hasTag("name", "select me and press N"))
                     .collect(Collectors.toList());
-            assertTrue(nodesToMove.size() == 1);
+            assertEquals(1, nodesToMove.size());
             Node toMove = nodesToMove.iterator().next();
             Node expected = new Node(new LatLon(-21.088998104148224, -50.38629102179512));
             ds.setSelected(toMove);
             action.actionPerformed(null);
-            assertTrue("Node was moved to an unexpected position", toMove.getEastNorth().equalsEpsilon(expected.getEastNorth(), 1e-7));
-            assertTrue("Node was not added to expected number of ways", toMove.getParentWays().size() == 4);
-
+            assertTrue(toMove.getEastNorth().equalsEpsilon(expected.getEastNorth(), 1e-7), "Node was moved to an unexpected position");
+            assertEquals(4, toMove.getParentWays().size(), "Node was not added to expected number of ways");
         } finally {
             MainApplication.getLayerManager().removeLayer(layer);
@@ -187,5 +188,5 @@
      */
     @Test
-    public void testTicket18420() throws Exception {
+    void testTicket18420() throws Exception {
         DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(18420, "user-sample.osm"), null);
         Layer layer = new OsmDataLayer(ds, OsmDataLayer.createNewName(), null);
@@ -193,5 +194,5 @@
         try {
             List<Node> nodesToMove = ds.getNodes().stream().filter(n -> n.hasTag("name")).collect(Collectors.toList());
-            assertTrue(nodesToMove.size() == 2);
+            assertEquals(2, nodesToMove.size());
             Node n = nodesToMove.iterator().next();
             if (!n.hasTag("name", "select me 1st"))
@@ -206,8 +207,8 @@
             action.setEnabled(true);
             action.actionPerformed(null);
-            assertTrue("Node was moved to an unexpected position", toMove1.getEastNorth().equalsEpsilon(expected1.getEastNorth(), 1e-7));
-            assertTrue("Node was moved to an unexpected position", toMove2.getEastNorth().equalsEpsilon(expected2.getEastNorth(), 1e-7));
-            assertTrue("Node was not added to expected number of ways", toMove1.getParentWays().size() == 2);
-            assertTrue("Node was not added to expected number of ways", toMove2.getParentWays().size() == 2);
+            assertTrue(toMove1.getEastNorth().equalsEpsilon(expected1.getEastNorth(), 1e-7), "Node was moved to an unexpected position");
+            assertTrue(toMove2.getEastNorth().equalsEpsilon(expected2.getEastNorth(), 1e-7), "Node was moved to an unexpected position");
+            assertEquals(2, toMove1.getParentWays().size(), "Node was not added to expected number of ways");
+            assertEquals(2, toMove2.getParentWays().size(), "Node was not added to expected number of ways");
         } finally {
             MainApplication.getLayerManager().removeLayer(layer);
@@ -220,5 +221,5 @@
      */
     @Test
-    public void testTicket18990() throws Exception {
+    void testTicket18990() throws Exception {
         DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(18990, "18990-sample.osm"), null);
         Layer layer = new OsmDataLayer(ds, OsmDataLayer.createNewName(), null);
@@ -226,5 +227,5 @@
         try {
             Node toMove = (Node) ds.getPrimitiveById(new SimplePrimitiveId(7018586511L, OsmPrimitiveType.NODE));
-            assertTrue(toMove != null);
+            assertNotNull(toMove);
             Node expected = new Node(new LatLon(43.48582074476985, -96.76897750613033));
 
@@ -234,8 +235,7 @@
             action.setEnabled(true);
             action.actionPerformed(null);
-            assertTrue("Node was moved to an unexpected position", toMove.getEastNorth().equalsEpsilon(expected.getEastNorth(), 1e-7));
-            assertTrue("Node was not added to expected way", toMove.getParentWays().size() == 1);
-            assertTrue("Node was not added to expected way segment",
-                    toMove.getParentWays().iterator().next().getNodes().indexOf(toMove) == 2);
+            assertTrue(toMove.getEastNorth().equalsEpsilon(expected.getEastNorth(), 1e-7), "Node was moved to an unexpected position");
+            assertEquals(1, toMove.getParentWays().size(), "Node was not added to expected way");
+            assertEquals(2, toMove.getParentWays().iterator().next().getNodes().indexOf(toMove), "Node was not added to expected way segment");
         } finally {
             MainApplication.getLayerManager().removeLayer(layer);
Index: trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.Collections;
@@ -10,7 +10,7 @@
 import javax.swing.JPanel;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -34,5 +34,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -58,5 +58,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         if (action == null) {
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testMergeNoSourceLayer() {
+    void testMergeNoSourceLayer() {
         assertNull(MainApplication.getLayerManager().getActiveLayer());
         action.actionPerformed(null);
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testMergeNoTargetLayer() {
+    void testMergeNoTargetLayer() {
         TestUtils.assumeWorkingJMockit();
         final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker(
@@ -105,5 +105,5 @@
      */
     @Test
-    public void testMergeTwoEmptyLayers() throws Exception {
+    void testMergeTwoEmptyLayers() throws Exception {
         TestUtils.assumeWorkingJMockit();
         final MergeLayerExtendedDialogMocker edMocker = new MergeLayerExtendedDialogMocker();
Index: trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java	(revision 17275)
@@ -2,12 +2,13 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Arrays;
 import java.util.Collections;
 
-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.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -21,10 +22,10 @@
  * Unit tests for class {@link MergeNodesAction}.
  */
-public class MergeNodesActionTest {
+class MergeNodesActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -33,7 +34,7 @@
      * Unit test of {@link MergeNodesAction#selectTargetLocationNode} - empty list
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testSelectTargetLocationNodeEmpty() {
-        MergeNodesAction.selectTargetLocationNode(Collections.emptyList());
+    @Test
+    void testSelectTargetLocationNodeEmpty() {
+        assertThrows(IllegalArgumentException.class, () -> MergeNodesAction.selectTargetLocationNode(Collections.emptyList()));
     }
 
@@ -41,8 +42,8 @@
      * Unit test of {@link MergeNodesAction#selectTargetLocationNode} - invalid mode
      */
-    @Test(expected = IllegalStateException.class)
-    public void testSelectTargetLocationNodeInvalidMode() {
+    @Test
+    void testSelectTargetLocationNodeInvalidMode() {
         Config.getPref().putInt("merge-nodes.mode", -1);
-        MergeNodesAction.selectTargetLocationNode(Arrays.asList(new Node(0), new Node(1)));
+        assertThrows(IllegalStateException.class, () -> MergeNodesAction.selectTargetLocationNode(Arrays.asList(new Node(0), new Node(1))));
     }
 
@@ -51,5 +52,5 @@
      */
     @Test
-    public void testSelectTargetLocationNode() {
+    void testSelectTargetLocationNode() {
         Config.getPref().putInt("merge-nodes.mode", 0);
         assertEquals(1, MergeNodesAction.selectTargetLocationNode(Arrays.asList(new Node(0), new Node(1))).getId());
@@ -68,5 +69,5 @@
      */
     @Test
-    public void testSelectTargetNode() {
+    void testSelectTargetNode() {
         assertNull(MergeNodesAction.selectTargetNode(Collections.emptyList()));
         DataSet ds = new DataSet();
Index: trunk/test/unit/org/openstreetmap/josm/actions/MoveActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/MoveActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/MoveActionTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.actions;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.MoveAction.Direction;
@@ -9,5 +9,5 @@
  * Unit tests for class {@link ExtensionFileFilter}.
  */
-public class MoveActionTest {
+class MoveActionTest {
 
     /**
@@ -15,5 +15,5 @@
      */
     @Test
-    public void testEnumDirection() {
+    void testEnumDirection() {
         TestUtils.superficialEnumCodeCoverage(Direction.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java	(revision 17275)
@@ -2,5 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.io.InputStream;
@@ -10,6 +11,6 @@
 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.TestUtils;
 import org.openstreetmap.josm.actions.OrthogonalizeAction.Direction;
@@ -32,20 +33,20 @@
  * Unit tests for class {@link OrthogonalizeAction}.
  */
-public class OrthogonalizeActionTest {
+class OrthogonalizeActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
 
-    @Test(expected = OrthogonalizeAction.InvalidUserInputException.class)
-    public void testNoSelection() throws Exception {
-        performTest("nothing selected");
+    @Test
+    void testNoSelection() throws Exception {
+        assertThrows(OrthogonalizeAction.InvalidUserInputException.class, () -> performTest("nothing selected"));
     }
 
     @Test
-    public void testClosedWay() throws Exception {
+    void testClosedWay() throws Exception {
         final DataSet ds = performTest("name=ClosedWay");
         final Way way = ds.getSelectedWays().iterator().next();
@@ -58,15 +59,15 @@
 
     @Test
-    public void testTwoWaysFormingClosedWay() throws Exception {
+    void testTwoWaysFormingClosedWay() throws Exception {
         performTest("name=TwoWaysFormingClosedWay");
     }
 
     @Test
-    public void testTwoRingsAtOnce() throws Exception {
+    void testTwoRingsAtOnce() throws Exception {
         performTest("name=ClosedWay OR name=TwoWaysFormingClosedWay");
     }
 
     @Test
-    public void testClosedWayWithReferenceNodes() throws Exception {
+    void testClosedWayWithReferenceNodes() throws Exception {
         final DataSet ds = performTest("name=ClosedWayWithReferenceNodes");
         final Way way = ds.getSelectedWays().iterator().next();
@@ -79,5 +80,5 @@
 
     @Test
-    public void testFourNodes() throws Exception {
+    void testFourNodes() throws Exception {
         final DataSet ds = performTest(
                 "name=NodeToRectify-01", "name=NodeToRectify-02", "name=NodeToRectify-03", "name=NodeToRectify-04");
@@ -94,5 +95,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(OrthogonalizeAction.EN.class);
     }
@@ -122,5 +123,5 @@
      */
     @Test
-    public void testEnumDirection() {
+    void testEnumDirection() {
         TestUtils.superficialEnumCodeCoverage(Direction.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.FileNotFoundException;
@@ -9,6 +9,6 @@
 import java.io.InputStream;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -25,10 +25,10 @@
  * Unit tests for class {@link PurgeAction}.
  */
-public class PurgeActionTest {
+class PurgeActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testCopyStringWayRelation() throws FileNotFoundException, IOException, IllegalDataException {
+    void testCopyStringWayRelation() throws FileNotFoundException, IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(12038, "data.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
Index: trunk/test/unit/org/openstreetmap/josm/actions/SelectAllActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/SelectAllActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/SelectAllActionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -15,10 +15,10 @@
  * Unit tests for class {@link SelectAllAction}.
  */
-public final class SelectAllActionTest {
+final class SelectAllActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules().preferences().projection().main();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testActionPerformed() {
+    void testActionPerformed() {
         SelectByInternalPointActionTest.initDataSet();
         DataSet ds = MainApplication.getLayerManager().getEditDataSet();
Index: trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+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.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -26,10 +26,10 @@
  * Unit tests for class {@link SelectByInternalPointAction}.
  */
-public final class SelectByInternalPointActionTest {
+final class SelectByInternalPointActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules().preferences().projection().main();
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(SelectByInternalPointAction.class);
     }
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testNoDataSet() {
+    void testNoDataSet() {
         assertNull(MainApplication.getLayerManager().getEditDataSet());
         assertEquals(0, SelectByInternalPointAction.getSurroundingObjects(null).size());
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testGetSurroundingObjects() {
+    void testGetSurroundingObjects() {
         initDataSet();
         assertEquals(0, SelectByInternalPointAction.getSurroundingObjects(null).size());
@@ -97,5 +97,5 @@
      */
     @Test
-    public void testGetSmallestSurroundingObject() {
+    void testGetSmallestSurroundingObject() {
         initDataSet();
         assertNull(SelectByInternalPointAction.getSmallestSurroundingObject(null));
@@ -107,5 +107,5 @@
      */
     @Test
-    public void testPerformSelection() {
+    void testPerformSelection() {
         initDataSet();
         DataSet ds = MainApplication.getLayerManager().getEditDataSet();
Index: trunk/test/unit/org/openstreetmap/josm/actions/SessionLoadActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/SessionLoadActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/SessionLoadActionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
@@ -16,10 +16,10 @@
  * Unit tests for class {@link SessionLoadAction}.
  */
-public class SessionLoadActionTest {
+class SessionLoadActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testTicket17702() {
+    void testTicket17702() {
         assertFalse(SessionLoadAction.Loader.addLayer(new TMSLayer(new ImageryInfo(
                 "Bing Карта (GLOBALCITY)",
Index: trunk/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests for class {@link SessionSaveAsAction}.
  */
-public class SessionSaveAsActionTest {
+class SessionSaveAsActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testSessionSaveAsAction() {
+    void testSessionSaveAsAction() {
         SessionSaveAsAction action = new SessionSaveAsAction();
         assertFalse(action.isEnabled());
Index: trunk/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.IOException;
@@ -16,7 +16,7 @@
 import java.util.stream.Stream;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -37,5 +37,5 @@
  * Unit tests for class {@link SimplifyWayAction}.
  */
-public final class SimplifyWayActionTest {
+final class SimplifyWayActionTest {
 
     /** Class under test. */
@@ -45,5 +45,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -52,5 +52,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         if (action == null) {
@@ -69,5 +69,5 @@
      */
     @Test
-    public void testSimplify() throws Exception {
+    void testSimplify() throws Exception {
         DataSet DsSimplify = getDs("tracks");
         DataSet DsExpected = getDs("tracks-simplify15");
@@ -91,5 +91,5 @@
      */
     @Test
-    public void testSimplifyFirstNode() {
+    void testSimplifyFirstNode() {
         final DataSet ds = new DataSet();
         final Node n1 = new Node(new LatLon(47.26269614984, 11.34044231149));
Index: trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java	(revision 17275)
@@ -2,13 +2,12 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.junit.Assert;
-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.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -21,13 +20,15 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Unit tests for class {@link SplitWayAction}.
  */
-public final class SplitWayActionTest {
+final class SplitWayActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -45,5 +46,5 @@
      */
     @Test
-    public void testTicket11184() {
+    void testTicket11184() {
         Node n1 = addNode(0, 0);
         Node n2 = addNode(-1, 1);
@@ -68,15 +69,11 @@
 
         // Ensures 3 ways.
-        assertSame(String.format("Found %d ways after split action instead of 3.", dataSet.getWays().size()),
-                   dataSet.getWays().size(), 3);
+        assertSame(3, dataSet.getWays().size(), String.format("Found %d ways after split action instead of 3.", dataSet.getWays().size()));
 
         // Ensures way w1 is unchanged.
-        assertTrue("Unselected ways disappear during split action.",
-                   dataSet.getWays().contains(w1));
-        assertSame("Unselected way seems to have change during split action.",
-                   w1.getNodesCount(), 3);
+        assertTrue(dataSet.getWays().contains(w1), "Unselected ways disappear during split action.");
+        assertSame(3, w1.getNodesCount(), "Unselected way seems to have change during split action.");
         for (int i = 0; i < 3; i++) {
-            assertSame("Node change in unselected way during split action.",
-                       w1.getNode(i), w1NodesArray[i]);
+            assertSame(w1.getNode(i), w1NodesArray[i], "Node change in unselected way during split action.");
         }
     }
@@ -88,5 +85,5 @@
      */
     @Test
-    public void testTicket17810() {
+    void testTicket17810() {
         DataSet dataSet = new DataSet();
         Way from = TestUtils.newWay("highway=residential", new Node(new LatLon(0.0, 0.0)),
@@ -122,5 +119,5 @@
      */
     @Test
-    public void testTicket18477() {
+    void testTicket18477() {
         final Node n10 = addNode(1, 0);
         final Node n21 = addNode(2, 1);
@@ -133,6 +130,5 @@
         dataSet.setSelected(n10, n21);
         SplitWayAction.runOn(dataSet);
-        assertSame(String.format("Found %d ways after split action instead of 4.", dataSet.getWays().size()),
-                dataSet.getWays().size(), 4);
+        assertSame(4, dataSet.getWays().size(), String.format("Found %d ways after split action instead of 4.", dataSet.getWays().size()));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -21,5 +21,5 @@
  * Unit tests for class {@link UnGlueAction}.
  */
-public final class UnGlueActionTest {
+final class UnGlueActionTest {
 
     /** Class under test. */
@@ -29,5 +29,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection().preferences();
@@ -36,5 +36,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         if (action == null) {
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testSelectionEmpty() {
+    void testSelectionEmpty() {
         DataSet ds = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(ds, "", null);
@@ -66,5 +66,5 @@
      */
     @Test
-    public void testSingleNodeNotInWay() {
+    void testSingleNodeNotInWay() {
         DataSet ds = new DataSet();
         Node n = new Node(LatLon.ZERO);
@@ -87,5 +87,5 @@
      */
     @Test
-    public void testSingleNodeInSingleWay() {
+    void testSingleNodeInSingleWay() {
         DataSet ds = new DataSet();
         Node n1 = new Node(LatLon.ZERO);
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testSingleNodeInTwoWays() {
+    void testSingleNodeInTwoWays() {
         DataSet ds = new DataSet();
         Node n1 = new Node(LatLon.ZERO);
Index: trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.actions;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
 import java.util.Arrays;
 
-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.data.coor.EastNorth;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -21,5 +21,5 @@
  * Unit tests for class {@link UnJoinNodeWayAction}.
  */
-public final class UnJoinNodeWayActionTest {
+final class UnJoinNodeWayActionTest {
 
     /**
@@ -40,5 +40,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testTicket10396() {
+    void testTicket10396() {
         DataSet dataSet = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
@@ -83,5 +83,5 @@
 
         // Ensures node n2 remove from w
-        assertFalse("Node n2 wasn't removed from way w.", w.containsNode(n2));
+        assertFalse(w.containsNode(n2), "Node n2 wasn't removed from way w.");
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrectorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrectorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrectorTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.actions.corrector;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.data.osm.Tagged;
@@ -16,10 +16,10 @@
  * Unit tests of {@link ReverseWayNoTagCorrector} class.
  */
-public class ReverseWayNoTagCorrectorTest {
+class ReverseWayNoTagCorrectorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testDirectionalTags() {
+    void testDirectionalTags() {
         assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("waterway", "drain")).size());
         assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("man_made", "embankment")).size());
Index: trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrectorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrectorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrectorTest.java	(revision 17275)
@@ -8,6 +8,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.correction.TagCorrection;
 import org.openstreetmap.josm.data.osm.Node;
@@ -24,10 +24,10 @@
  * Unit tests of {@link ReverseWayTagCorrector} class.
  */
-public class ReverseWayTagCorrectorTest {
+class ReverseWayTagCorrectorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -38,5 +38,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(ReverseWayTagCorrector.TagSwitcher.class);
     }
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testTagSwitch() {
+    void testTagSwitch() {
         // oneway
         assertSwitch(new Tag("oneway", "yes"), new Tag("oneway", "-1"));
@@ -121,5 +121,5 @@
      */
     @Test
-    public void testSwitchingWayNodes() {
+    void testSwitchingWayNodes() {
         final Map<OsmPrimitive, List<TagCorrection>> tagCorrections = getTagCorrectionsForWay("direction=forward");
         Assert.assertEquals(1, tagCorrections.size());
@@ -132,5 +132,5 @@
      */
     @Test
-    public void testNotSwitchingWayNodes() {
+    void testNotSwitchingWayNodes() {
         Assert.assertEquals(0, getTagCorrectionsForWay("direction=SSW").size());
         Assert.assertEquals(0, getTagCorrectionsForWay("direction=145").size());
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetContentDownloadTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetContentDownloadTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetContentDownloadTaskTest.java	(revision 17275)
@@ -2,11 +2,12 @@
 package org.openstreetmap.josm.actions.downloadtasks;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.Component;
 import java.util.Arrays;
 
-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.testutils.JOSMTestRules;
 
@@ -16,10 +17,10 @@
  * Unit tests for class {@link ChangesetContentDownloadTask}.
  */
-public class ChangesetContentDownloadTaskTest {
+class ChangesetContentDownloadTaskTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -29,5 +30,5 @@
      */
     @Test
-    public void testChangesetContentDownloadTask() {
+    void testChangesetContentDownloadTask() {
         Component parent = new Component() {
             // empty component
@@ -41,7 +42,7 @@
      * Unit test of {@code ChangesetContentDownloadTask#ChangesetContentDownloadTask} - invalid changeset id.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testChangesetContentDownloadTaskInvalidId() {
-        new ChangesetContentDownloadTask(0);
+    @Test
+    void testChangesetContentDownloadTaskInvalidId() {
+        assertThrows(IllegalArgumentException.class, () -> new ChangesetContentDownloadTask(0));
     }
 
@@ -49,7 +50,7 @@
      * Unit test of {@code ChangesetContentDownloadTask#ChangesetContentDownloadTask} - null parent.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testChangesetContentDownloadTaskNullParent1() {
-        new ChangesetContentDownloadTask(1);
+    @Test
+    void testChangesetContentDownloadTaskNullParent1() {
+        assertThrows(IllegalArgumentException.class, () -> new ChangesetContentDownloadTask(1));
     }
 
@@ -57,7 +58,7 @@
      * Unit test of {@code ChangesetContentDownloadTask#ChangesetContentDownloadTask} - null parent.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testChangesetContentDownloadTaskNullParent2() {
-        new ChangesetContentDownloadTask(Arrays.asList(1, 2));
+    @Test
+    void testChangesetContentDownloadTaskNullParent2() {
+        assertThrows(IllegalArgumentException.class, () -> new ChangesetContentDownloadTask(Arrays.asList(1, 2)));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetHeaderDownloadTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetHeaderDownloadTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetHeaderDownloadTaskTest.java	(revision 17275)
@@ -2,11 +2,12 @@
 package org.openstreetmap.josm.actions.downloadtasks;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.Component;
 import java.util.Collections;
 
-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.data.osm.Changeset;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -17,10 +18,10 @@
  * Unit tests for class {@link ChangesetHeaderDownloadTask}.
  */
-public class ChangesetHeaderDownloadTaskTest {
+class ChangesetHeaderDownloadTaskTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +31,5 @@
      */
     @Test
-    public void testBuildTaskForChangesets() {
+    void testBuildTaskForChangesets() {
         Component parent = new Component() {
             // empty component
@@ -42,7 +43,8 @@
      * Unit test of {@code ChangesetHeaderDownloadTask#buildTaskForChangesets} - null parent.
      */
-    @Test(expected = NullPointerException.class)
-    public void testBuildTaskForChangesetsNullParent() {
-        ChangesetHeaderDownloadTask.buildTaskForChangesets(Collections.singleton(new Changeset(1)));
+    @Test
+    void testBuildTaskForChangesetsNullParent() {
+        assertThrows(NullPointerException.class,
+                () -> ChangesetHeaderDownloadTask.buildTaskForChangesets(Collections.singleton(new Changeset(1))));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetQueryTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetQueryTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/ChangesetQueryTaskTest.java	(revision 17275)
@@ -2,10 +2,11 @@
 package org.openstreetmap.josm.actions.downloadtasks;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.Component;
 
-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.io.ChangesetQuery;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,10 +17,10 @@
  * Unit tests for class {@link ChangesetQueryTask}.
  */
-public class ChangesetQueryTaskTest {
+class ChangesetQueryTaskTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -29,5 +30,5 @@
      */
     @Test
-    public void testChangesetQueryTask() {
+    void testChangesetQueryTask() {
         Component parent = new Component() {
             // empty component
@@ -39,7 +40,7 @@
      * Unit test of {@code ChangesetQueryTask#ChangesetQueryTask} - null parent.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testChangesetQueryTaskNullParent() {
-        new ChangesetQueryTask(new ChangesetQuery());
+    @Test
+    void testChangesetQueryTaskNullParent() {
+        assertThrows(IllegalArgumentException.class, () -> new ChangesetQueryTask(new ChangesetQuery()));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTaskTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.actions.downloadtasks;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
-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.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -20,10 +20,10 @@
  * Unit tests for class {@link DownloadReferrersTask}.
  */
-public class DownloadReferrersTaskTest {
+class DownloadReferrersTaskTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testDownloadReferrersTask() {
+    void testDownloadReferrersTask() {
         DataSet ds = new DataSet();
         Node n1 = (Node) OsmPrimitiveType.NODE.newInstance(-1, true);
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskListTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskListTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskListTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.actions.downloadtasks;
 
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.awt.geom.Area;
 import java.util.Collections;
 
-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.data.Bounds;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
@@ -19,10 +19,10 @@
  * Unit tests for class {@link DownloadTaskList}.
  */
-public class DownloadTaskListTest {
+class DownloadTaskListTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testDownloadTaskList() {
+    void testDownloadTaskList() {
         assertTrue(new DownloadTaskList().getDownloadedPrimitives().isEmpty());
     }
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testDownloadAreaEmpty() throws Exception {
+    void testDownloadAreaEmpty() throws Exception {
         DownloadTaskList list = new DownloadTaskList();
         assertNull(list.download(false,
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandlerTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.actions.downloadtasks;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.net.URL;
@@ -13,6 +13,6 @@
 import java.util.concurrent.TimeoutException;
 
-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.data.Bounds;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
@@ -25,10 +25,10 @@
  * Unit tests for class {@link PostDownloadHandler}.
  */
-public class PostDownloadHandlerTest {
+class PostDownloadHandlerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -124,10 +124,11 @@
      */
     @Test
-    public void testRunExceptionFuture() {
+    void testRunExceptionFuture() {
         Logging.clearLastErrorAndWarnings();
         new PostDownloadHandler(null, newFuture("testRunExceptionFuture")).run();
-        assertTrue(Logging.getLastErrorAndWarnings().toString(),
+        assertTrue(
                 Logging.getLastErrorAndWarnings().stream()
-                        .anyMatch(e -> e.endsWith("E: java.util.concurrent.ExecutionException: testRunExceptionFuture")));
+                        .anyMatch(e -> e.endsWith("E: java.util.concurrent.ExecutionException: testRunExceptionFuture")),
+                        Logging.getLastErrorAndWarnings().toString());
     }
 
@@ -136,8 +137,8 @@
      */
     @Test
-    public void testRunNoError() {
+    void testRunNoError() {
         Logging.clearLastErrorAndWarnings();
         new PostDownloadHandler(newTask(Collections.emptyList()), newFuture(null)).run();
-        assertTrue(Logging.getLastErrorAndWarnings().toString(), Logging.getLastErrorAndWarnings().isEmpty());
+        assertTrue(Logging.getLastErrorAndWarnings().isEmpty(), Logging.getLastErrorAndWarnings().toString());
     }
 
@@ -146,8 +147,8 @@
      */
     @Test
-    public void testRunOneError() {
+    void testRunOneError() {
         Logging.clearLastErrorAndWarnings();
         new PostDownloadHandler(newTask(Collections.singletonList(new Object())), newFuture(null)).run();
-        assertTrue(Logging.getLastErrorAndWarnings().toString(), Logging.getLastErrorAndWarnings().isEmpty());
+        assertTrue(Logging.getLastErrorAndWarnings().isEmpty(), Logging.getLastErrorAndWarnings().toString());
     }
 
@@ -156,10 +157,10 @@
      */
     @Test
-    public void testRunMultipleErrors() {
+    void testRunMultipleErrors() {
         Logging.clearLastErrorAndWarnings();
         new PostDownloadHandler(newTask(Arrays.asList("foo", new Exception("bar"), new Object())), newFuture(null)).run();
-        assertTrue(Logging.getLastErrorAndWarnings().toString(),
+        assertTrue(
                 Logging.getLastErrorAndWarnings().stream()
-                        .anyMatch(e -> e.endsWith("E: java.lang.Exception: bar")));
+                        .anyMatch(e -> e.endsWith("E: java.lang.Exception: bar")), Logging.getLastErrorAndWarnings().toString());
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.actions.mapmode;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -19,10 +19,10 @@
  * Unit tests for class {@link AddNoteAction}.
  */
-public class AddNoteActionTest {
+class AddNoteActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testMode() {
+    void testMode() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         try {
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.actions.mapmode;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -20,10 +20,10 @@
  * Unit tests for class {@link DeleteAction}.
  */
-public class DeleteActionTest {
+class DeleteActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testMode() {
+    void testMode() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         try {
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testEnumDeleteMode() {
+    void testEnumDeleteMode() {
         TestUtils.superficialEnumCodeCoverage(DeleteMode.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.actions.mapmode;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.event.InputEvent;
@@ -14,6 +14,6 @@
 import javax.swing.JList;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.UndoRedoHandler;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -33,10 +33,10 @@
  * Unit tests for class {@link DrawAction}.
  */
-public class DrawActionTest {
+class DrawActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection().timeout(20000);
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testTicket12011() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
+    void testTicket12011() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
         DataSet dataSet = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.actions.mapmode;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -20,10 +20,10 @@
  * Unit tests for class {@link ExtrudeAction}.
  */
-public class ExtrudeActionTest {
+class ExtrudeActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testMode() {
+    void testMode() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         try {
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testEnumMode() {
+    void testEnumMode() {
         TestUtils.superficialEnumCodeCoverage(Mode.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.actions.mapmode;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -20,10 +20,10 @@
  * Unit tests for class {@link ImproveWayAccuracyAction}.
  */
-public class ImproveWayAccuracyActionTest {
+class ImproveWayAccuracyActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testMode() {
+    void testMode() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         try {
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testEnumState() {
+    void testEnumState() {
         TestUtils.superficialEnumCodeCoverage(State.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.actions.mapmode;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -21,10 +21,10 @@
  * Unit tests for class {@link ParallelWayAction}.
  */
-public class ParallelWayActionTest {
+class ParallelWayActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testMode() {
+    void testMode() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         try {
@@ -53,5 +53,5 @@
      */
     @Test
-    public void testEnumMode() {
+    void testEnumMode() {
         TestUtils.superficialEnumCodeCoverage(Mode.class);
     }
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testEnumModifier() {
+    void testEnumModifier() {
         TestUtils.superficialEnumCodeCoverage(Modifier.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.actions.mapmode;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -19,10 +19,10 @@
  * Unit tests for class {@link PlayHeadDragMode}.
  */
-public class PlayHeadDragModeTest {
+class PlayHeadDragModeTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testMode() {
+    void testMode() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         try {
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.actions.mapmode;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.event.InputEvent;
@@ -12,6 +12,6 @@
 import java.util.Collection;
 
-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.TestUtils;
 import org.openstreetmap.josm.actions.mapmode.SelectAction.Mode;
@@ -34,5 +34,5 @@
  * Unit tests for class {@link SelectAction}.
  */
-public class SelectActionTest {
+class SelectActionTest {
 
     boolean nodesMerged;
@@ -49,6 +49,5 @@
         public void mergeNodes(OsmDataLayer layer, Collection<Node> nodes,
                                Node targetLocationNode) {
-            assertSame(String.format("Should merge two nodes, %d found", nodes.size()),
-                       nodes.size(), 2);
+            assertSame(2, nodes.size(), String.format("Should merge two nodes, %d found", nodes.size()));
             nodesMerged = true;
         }
@@ -58,5 +57,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().main();
@@ -70,5 +69,5 @@
     @Test
     @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
-    public void testTicket10748() throws ReflectiveOperationException {
+    void testTicket10748() throws ReflectiveOperationException {
         DataSet dataSet = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
@@ -125,11 +124,9 @@
 
             // As result of test, we must find a 2 nodes way, from EN(0, 0) to EN(100, 0)
-            assertTrue("Nodes are not merged", nodesMerged);
-            assertSame(String.format("Expect exactly one way, found %d%n", dataSet.getWays().size()),
-                       dataSet.getWays().size(), 1);
+            assertTrue(nodesMerged, "Nodes are not merged");
+            assertSame(1, dataSet.getWays().size(), String.format("Expect exactly one way, found %d%n", dataSet.getWays().size()));
             Way rw = dataSet.getWays().iterator().next();
-            assertFalse("Way shouldn't be deleted\n", rw.isDeleted());
-            assertSame(String.format("Way shouldn't have 2 nodes, %d found%n", w.getNodesCount()),
-                       rw.getNodesCount(), 2);
+            assertFalse(rw.isDeleted(), "Way shouldn't be deleted\n");
+            assertSame(2, rw.getNodesCount(), String.format("Way shouldn't have 2 nodes, %d found%n", w.getNodesCount()));
             Node r1 = rw.firstNode();
             Node r2 = rw.lastNode();
@@ -139,8 +136,8 @@
                 r2 = tmp;
             }
-            assertSame(String.format("East should be 0, found %f%n", r1.getEastNorth().east()),
-                       Double.compare(r1.getEastNorth().east(), 0), 0);
-            assertSame(String.format("East should be 100, found %f%n", r2.getEastNorth().east()),
-                       Double.compare(r2.getEastNorth().east(), 100), 0);
+            assertSame(0, Double.compare(r1.getEastNorth().east(), 0),
+                    String.format("East should be 0, found %f%n", r1.getEastNorth().east()));
+            assertSame(0, Double.compare(r2.getEastNorth().east(), 100),
+                    String.format("East should be 100, found %f%n", r2.getEastNorth().east()));
         } finally {
             // Ensure we clean the place before leaving, even if test fails.
@@ -153,5 +150,5 @@
      */
     @Test
-    public void testEnumMode() {
+    void testEnumMode() {
         TestUtils.superficialEnumCodeCoverage(Mode.class);
     }
@@ -161,5 +158,5 @@
      */
     @Test
-    public void testEnumSelectActionCursor() {
+    void testEnumSelectActionCursor() {
         TestUtils.superficialEnumCodeCoverage(SelectActionCursor.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.actions.upload;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
 import java.util.Collection;
 
-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.PseudoCommand;
 import org.openstreetmap.josm.command.SequenceCommand;
@@ -27,10 +27,10 @@
  * Unit tests for class {@link FixDataHook}.
  */
-public class FixDataHookTest {
+class FixDataHookTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testCheckUpload() {
+    void testCheckUpload() {
         // Empty data set
         UndoRedoHandler.getInstance().clean();
@@ -85,5 +85,5 @@
         assertEquals(9, prims.size());
         for (OsmPrimitive o : Arrays.asList(w1, w2, w3, w4, w5, w6, w7, r1, r2)) {
-            assertTrue(o.toString(), prims.contains(o));
+            assertTrue(prims.contains(o), o.toString());
         }
         Collection<PseudoCommand> cmds = seq.getChildren();
Index: trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.actions.upload;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.APIDataSet;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests for class {@link ValidateUploadHook}.
  */
-public class ValidateUploadHookTest {
+class ValidateUploadHookTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().fakeAPI().timeout(30000);
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testCheckUpload() {
+    void testCheckUpload() {
         assertTrue(new ValidateUploadHook().checkUpload(new APIDataSet()));
     }
Index: trunk/test/unit/org/openstreetmap/josm/command/AddCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/AddCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/AddCommandTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -27,10 +27,10 @@
  * Unit tests of {@link AddCommand} class.
  */
-public class AddCommandTest {
+class AddCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testAdd() {
+    void testAdd() {
         DataSet ds = new DataSet();
         assertArrayEquals(new Object[0], ds.allPrimitives().toArray());
@@ -56,5 +56,5 @@
      */
     @Test
-    public void testAddToLayer() {
+    void testAddToLayer() {
         DataSet ds1 = new DataSet();
         DataSet ds2 = new DataSet();
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         Node osm = new Node(LatLon.ZERO);
         DataSet ds = new DataSet(osm);
@@ -86,5 +86,5 @@
      */
     @Test
-    public void testParticipatingPrimitives() {
+    void testParticipatingPrimitives() {
         Node osm = new Node(LatLon.ZERO);
 
@@ -96,5 +96,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         Node osm = new Node(LatLon.ZERO);
 
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         Node node = new Node(LatLon.ZERO);
         node.put("name", "xy");
@@ -131,5 +131,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(AddCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
@@ -12,6 +12,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -34,10 +34,10 @@
  * Unit tests of {@link AddPrimitivesCommand} class.
  */
-public class AddPrimitivesCommandTest {
+class AddPrimitivesCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testAdd() {
+    void testAdd() {
         DataSet ds = new DataSet();
 
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testAddSetSelection() {
+    void testAddSetSelection() {
         DataSet ds = new DataSet();
 
@@ -77,5 +77,5 @@
      */
     @Test
-    public void testAddToLayer() {
+    void testAddToLayer() {
         DataSet ds1 = new DataSet();
         DataSet ds2 = new DataSet();
@@ -95,5 +95,5 @@
      */
     @Test
-    public void testAddIgnoresExisting() {
+    void testAddIgnoresExisting() {
         DataSet ds = new DataSet();
 
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         DataSet ds = new DataSet();
 
@@ -138,5 +138,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         DataSet ds = new DataSet();
 
@@ -172,5 +172,5 @@
      */
     @Test
-    public void testUndoIgnoresExisting() {
+    void testUndoIgnoresExisting() {
         DataSet ds = new DataSet();
 
@@ -208,5 +208,5 @@
      */
     @Test
-    public void testUndoIgnoresExistingAsDeleted() {
+    void testUndoIgnoresExistingAsDeleted() {
         DataSet ds = new DataSet();
 
@@ -243,5 +243,5 @@
      */
     @Test
-    public void testUndoIgnoresExistingSameUniqueIdDifferentType() {
+    void testUndoIgnoresExistingSameUniqueIdDifferentType() {
         DataSet ds = new DataSet();
 
@@ -288,5 +288,5 @@
      */
     @Test
-    public void testParticipatingPrimitives() {
+    void testParticipatingPrimitives() {
         DataSet ds = new DataSet();
 
@@ -308,5 +308,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -364,5 +364,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(AddPrimitivesCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/ChangeCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/ChangeCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/ChangeCommandTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.util.ArrayList;
@@ -11,7 +12,7 @@
 import java.util.List;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -34,10 +35,10 @@
  * Unit tests of {@link ChangeCommand} class.
  */
-public class ChangeCommandTest {
+class ChangeCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -47,5 +48,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestData();
@@ -55,8 +56,8 @@
      * Test that empty ways are prevented.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testPreventEmptyWays() {
+    @Test
+    void testPreventEmptyWays() {
         Way emptyWay = new Way();
-        new ChangeCommand(testData.existingWay, emptyWay);
+        assertThrows(IllegalArgumentException.class, () -> new ChangeCommand(testData.existingWay, emptyWay));
     }
 
@@ -65,5 +66,5 @@
      */
     @Test
-    public void testChange() {
+    void testChange() {
         Node newNode = new Node(5);
         newNode.setCoor(LatLon.NORTH_POLE);
@@ -88,10 +89,10 @@
      * Test {@link ChangeCommand#executeCommand()} fails if ID is changed
      */
-    @Test(expected = DataIntegrityProblemException.class)
-    public void testChangeIdChange() {
+    @Test
+    void testChangeIdChange() {
         Node newNode = new Node(1);
         newNode.setCoor(LatLon.NORTH_POLE);
 
-        new ChangeCommand(testData.existingNode, newNode).executeCommand();
+        assertThrows(DataIntegrityProblemException.class, () -> new ChangeCommand(testData.existingNode, newNode).executeCommand());
     }
 
@@ -100,5 +101,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         Node newNode = new Node(5);
         newNode.setCoor(LatLon.NORTH_POLE);
@@ -121,5 +122,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -135,5 +136,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         Node node = new Node(LatLon.ZERO);
         node.put("name", "xy");
@@ -154,5 +155,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ChangeCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/ChangeMembersCommandTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 import java.util.List;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -28,10 +28,10 @@
  * Unit tests of {@link ChangeMembersCommand} class.
  */
-public class ChangeMembersCommandTest {
+class ChangeMembersCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -41,5 +41,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestDataWithRelation();
@@ -50,5 +50,5 @@
      */
     @Test
-    public void testChange() {
+    void testChange() {
         assertTrue(testData.existingNode.getReferrers().contains(testData.existingRelation));
         assertEquals(2, testData.existingRelation.getMembersCount());
@@ -70,5 +70,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         List<RelationMember> members = testData.existingRelation.getMembers();
         members.add(new RelationMember("n2", testData.existingNode2));
@@ -86,5 +86,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         testData.existingRelation.put("name", "xy");
         List<RelationMember> members = testData.existingRelation.getMembers();
@@ -97,5 +97,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ChangeMembersCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/ChangeNodesCommandTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.ArrayList;
@@ -12,7 +13,7 @@
 import java.util.List;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -33,10 +34,10 @@
  * Unit tests of {@link ChangeNodesCommand} class.
  */
-public class ChangeNodesCommandTest {
+class ChangeNodesCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -46,5 +47,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestData();
@@ -54,7 +55,7 @@
      * Test that empty ways are prevented.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testPreventEmptyWays() {
-        new ChangeNodesCommand(testData.existingWay, Collections.<Node>emptyList());
+    @Test
+    void testPreventEmptyWays() {
+        assertThrows(IllegalArgumentException.class, () -> new ChangeNodesCommand(testData.existingWay, Collections.<Node>emptyList()));
     }
 
@@ -63,5 +64,5 @@
      */
     @Test
-    public void testChange() {
+    void testChange() {
         List<Node> newNodes = testData.existingWay.getNodes();
         Collections.reverse(newNodes);
@@ -79,5 +80,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         List<Node> newNodes = testData.existingWay.getNodes();
         Collections.reverse(newNodes);
@@ -95,5 +96,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -110,5 +111,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         Node node = new Node(LatLon.ZERO);
         node.put("name", "xy");
@@ -125,5 +126,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ChangeNodesCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyCommandTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
@@ -14,7 +14,7 @@
 import java.util.List;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -36,10 +36,10 @@
  * Unit tests of {@link ChangePropertyCommand} class.
  */
-public class ChangePropertyCommandTest {
+class ChangePropertyCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -49,5 +49,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestData();
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testShortConstructor() {
+    void testShortConstructor() {
         ChangePropertyCommand command = new ChangePropertyCommand(Arrays.asList(testData.existingNode), "a", "b");
         assertEquals("b", command.getTags().get("a"));
@@ -74,5 +74,5 @@
      */
     @Test
-    public void testUpdateSingleProperty() {
+    void testUpdateSingleProperty() {
         Node node1 = testData.createNode(14);
         Node node2 = testData.createNode(15);
@@ -93,5 +93,5 @@
      */
     @Test
-    public void testRemoveProperty() {
+    void testRemoveProperty() {
         Node node1 = testData.createNode(14);
         Node node2 = testData.createNode(15);
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testUpdateMultipleProperties() {
+    void testUpdateMultipleProperties() {
         Node node1 = testData.createNode(14);
         Node node2 = testData.createNode(15);
@@ -139,5 +139,5 @@
      */
     @Test
-    public void testUpdateIgnoresExistingProperty() {
+    void testUpdateIgnoresExistingProperty() {
         Node node1 = testData.createNode(14);
         Node node2 = testData.createNode(15);
@@ -159,5 +159,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         Node node1 = testData.createNode(14);
         Node node2 = testData.createNode(15);
@@ -188,5 +188,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         Node node1 = testData.createNode(14);
         Node node2 = testData.createNode(15);
@@ -252,5 +252,5 @@
      */
     @Test
-    public void testChildren() {
+    void testChildren() {
         Node node1 = testData.createNode(15);
         Node node2 = testData.createNode(16);
@@ -278,5 +278,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ChangePropertyCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/ChangePropertyKeyCommandTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
@@ -11,7 +11,7 @@
 import java.util.Collection;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -30,10 +30,10 @@
  * Unit tests of {@link ChangePropertyKeyCommand} class.
  */
-public class ChangePropertyKeyCommandTest {
+class ChangePropertyKeyCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -43,5 +43,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestData();
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testChangeKeySingle() {
+    void testChangeKeySingle() {
         assertTrue(new ChangePropertyKeyCommand(testData.existingNode, "existing", "newKey").executeCommand());
 
@@ -64,5 +64,5 @@
      */
     @Test
-    public void testChangeKey() {
+    void testChangeKey() {
         assertTrue(new ChangePropertyKeyCommand(Arrays.asList(testData.existingNode, testData.existingWay), "existing",
                 "newKey").executeCommand());
@@ -80,5 +80,5 @@
      */
     @Test
-    public void testChangeKeyIgnored() {
+    void testChangeKeyIgnored() {
         Node node1 = testData.createNode(15);
         node1.removeAll();
@@ -109,5 +109,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         Node node1 = testData.createNode(15);
         node1.put("name", "xy");
@@ -123,5 +123,5 @@
      */
     @Test
-    public void testChildren() {
+    void testChildren() {
         Node node1 = testData.createNode(15);
         Node node2 = testData.createNode(16);
@@ -149,5 +149,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ChangePropertyKeyCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommandTest.java	(revision 17275)
@@ -2,15 +2,15 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -29,10 +29,10 @@
  * Unit tests of {@link ChangeRelationMemberRoleCommand} class.
  */
-public class ChangeRelationMemberRoleCommandTest {
+class ChangeRelationMemberRoleCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -42,5 +42,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestDataWithRelation();
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testRoleChanged() {
+    void testRoleChanged() {
         assertTrue(new ChangeRelationMemberRoleCommand(testData.existingRelation, 0, "newRole").executeCommand());
         assertEquals("newRole", testData.existingRelation.getMember(0).getRole());
@@ -67,5 +67,5 @@
      */
     @Test
-    public void testWrongIndex() {
+    void testWrongIndex() {
         // should be ignored
         ChangeRelationMemberRoleCommand command1 = new ChangeRelationMemberRoleCommand(testData.existingRelation, -1, "newRole");
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testSameRole() {
+    void testSameRole() {
         // should be ignored
         assertTrue(new ChangeRelationMemberRoleCommand(testData.existingRelation, 0, "node").executeCommand());
@@ -95,5 +95,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         ChangeRelationMemberRoleCommand command = new ChangeRelationMemberRoleCommand(testData.existingRelation, 0, "newRole");
         command.executeCommand();
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -128,5 +128,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         testData.existingRelation.put("name", "xy");
         assertTrue(new ChangeRelationMemberRoleCommand(testData.existingRelation, 0, "newRole").getDescriptionText()
@@ -138,5 +138,5 @@
      */
     @Test
-    public void testChildren() {
+    void testChildren() {
         assertNull(new ChangeRelationMemberRoleCommand(testData.existingRelation, 0, "newRole").getChildren());
     }
@@ -146,5 +146,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ChangeRelationMemberRoleCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/CommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/CommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/CommandTest.java	(revision 17275)
@@ -4,6 +4,6 @@
 import java.util.Arrays;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -30,5 +30,5 @@
      * We need prefs for nodes / data sets.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -38,5 +38,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(Command.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/DeleteCommandTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.ArrayList;
@@ -13,7 +14,7 @@
 import java.util.NoSuchElementException;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -35,10 +36,10 @@
  * Unit tests of {@link DeleteCommand} class.
  */
-public class DeleteCommandTest {
+class DeleteCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -48,5 +49,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestDataWithRelation();
@@ -57,5 +58,5 @@
      */
     @Test
-    public void testSimpleDelete() {
+    void testSimpleDelete() {
         Node node = testData.createNode(15);
         assertTrue(testData.layer.data.allPrimitives().contains(node));
@@ -72,5 +73,5 @@
      */
     @Test
-    public void testDeleteIgnoresReferences() {
+    void testDeleteIgnoresReferences() {
         assertTrue(testData.existingNode.getReferrers().contains(testData.existingRelation));
         new DeleteCommand(testData.existingRelation).executeCommand();
@@ -92,9 +93,9 @@
      * A delete should delete all objects with references to the deleted one
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testDeleteFailsOnDelted() {
+    @Test
+    void testDeleteFailsOnDeleted() {
         new DeleteCommand(testData.existingRelation).executeCommand();
 
-        new DeleteCommand(testData.existingRelation).executeCommand();
+        assertThrows(IllegalArgumentException.class, () -> new DeleteCommand(testData.existingRelation).executeCommand());
     }
 
@@ -103,5 +104,5 @@
      */
     @Test
-    public void testReferredDelete() {
+    void testReferredDelete() {
         DeleteCommand.deleteWithReferences(Arrays.asList(testData.existingNode), true).executeCommand();
 
@@ -115,5 +116,5 @@
      */
     @Test
-    public void testDeleteNodesInWay() {
+    void testDeleteNodesInWay() {
         testData.existingNode.removeAll();
         // That untagged node should be deleted.
@@ -152,7 +153,7 @@
      * Test that {@link DeleteCommand} checks for non-null.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testConsistency() {
-        new DeleteCommand(Arrays.asList(testData.existingNode, testData.existingWay, null));
+    @Test
+    void testConsistency() {
+        assertThrows(IllegalArgumentException.class, () -> new DeleteCommand(Arrays.asList(testData.existingNode, testData.existingWay, null)));
     }
 
@@ -160,8 +161,8 @@
      * Test that {@link DeleteCommand} checks for the dataset
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testConsistencyDataset() {
+    @Test
+    void testConsistencyDataset() {
         testData.layer.getDataSet().removePrimitive(testData.existingNode);
-        new DeleteCommand(Arrays.asList(testData.existingNode, testData.existingWay));
+        assertThrows(IllegalArgumentException.class, () -> new DeleteCommand(Arrays.asList(testData.existingNode, testData.existingWay)));
     }
 
@@ -169,7 +170,7 @@
      * Test that {@link DeleteCommand} checks for non-empty list
      */
-    @Test(expected = NoSuchElementException.class)
-    public void testConsistencyNonEmpty() {
-        new DeleteCommand(Arrays.<OsmPrimitive>asList());
+    @Test
+    void testConsistencyNonEmpty() {
+        assertThrows(NoSuchElementException.class, () -> new DeleteCommand(Arrays.<OsmPrimitive>asList()));
     }
 
@@ -177,7 +178,7 @@
      * Test that {@link DeleteCommand} checks for non-null list
      */
-    @Test(expected = NullPointerException.class)
-    public void testConsistencyNonNull() {
-        new DeleteCommand((Collection<OsmPrimitive>) null);
+    @Test
+    void testConsistencyNonNull() {
+        assertThrows(NullPointerException.class, () -> new DeleteCommand((Collection<OsmPrimitive>) null));
     }
 
@@ -186,5 +187,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         DeleteCommand command = new DeleteCommand(
                 Arrays.asList(testData.existingNode, testData.existingNode2, testData.existingWay));
@@ -211,5 +212,5 @@
      */
     @Test
-    public void testDeleteWaySegment() {
+    void testDeleteWaySegment() {
         Way way1 = testData.createWay(100, testData.createNode(101), testData.createNode(102));
         WaySegment ws = new WaySegment(way1, 0);
@@ -225,5 +226,5 @@
      */
     @Test
-    public void testDeleteWaySegmentEndOfWay() {
+    void testDeleteWaySegmentEndOfWay() {
         Way way = testData.createWay(200, testData.createNode(201), testData.createNode(202), testData.createNode(203),
                 testData.createNode(204));
@@ -243,5 +244,5 @@
      */
     @Test
-    public void testDeleteWaySegmentStartOfWay() {
+    void testDeleteWaySegmentStartOfWay() {
         Way way = testData.createWay(100, testData.createNode(101), testData.createNode(102), testData.createNode(103),
                 testData.createNode(104));
@@ -261,5 +262,5 @@
      */
     @Test
-    public void testDeleteWaySegmentSplit() {
+    void testDeleteWaySegmentSplit() {
         Node node103 = testData.createNode(103);
         Node node104 = testData.createNode(104);
@@ -285,5 +286,5 @@
      */
     @Test
-    public void testDeleteWaySegmentCycle() {
+    void testDeleteWaySegmentCycle() {
         Node n = testData.createNode(101);
         Way way = testData.createWay(100, n, testData.createNode(102), testData.createNode(103),
@@ -304,5 +305,5 @@
      */
     @Test
-    public void testGetChildren() {
+    void testGetChildren() {
         testData.existingNode.put("name", "xy");
         Collection<PseudoCommand> children = new DeleteCommand(Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingNode2))
@@ -319,5 +320,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -334,5 +335,5 @@
      */
     @Test
-    public void testGetParticipatingPrimitives() {
+    void testGetParticipatingPrimitives() {
         DeleteCommand command = new DeleteCommand(Arrays.<OsmPrimitive>asList(testData.existingNode));
         assertArrayEquals(new Object[] {testData.existingNode }, command.getParticipatingPrimitives().toArray());
@@ -348,5 +349,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         Node node = testData.createNode(100);
         node.put("name", "xy");
@@ -378,5 +379,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(DeleteCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
@@ -12,7 +12,7 @@
 import java.util.Set;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -34,9 +34,9 @@
  * Unit tests of {@link MoveCommand} class.
  */
-public class MoveCommandTest {
+class MoveCommandTest {
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n().projection();
@@ -46,5 +46,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestDataWithRelation();
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testConstructors() {
+    void testConstructors() {
         EastNorth offset = new EastNorth(1, 2);
         LatLon destLatLon = ProjectionRegistry.getProjection().eastNorth2latlon(offset);
@@ -75,7 +75,7 @@
         assertEquals(nodes, new ArrayList<>(Collections.<OsmPrimitive>singleton(testData.existingNode)));
 
-        assertEquals("east", 1, moveCommand.getOffset().east(), 0.0001);
-        assertEquals("north", 2, moveCommand.getOffset().north(), 0.0001);
-        assertEquals("distance", 2.236068, moveCommand.getDistance(n -> true), 0.0001);
+        assertEquals(1, moveCommand.getOffset().east(), 0.0001, "east");
+        assertEquals(2, moveCommand.getOffset().north(), 0.0001, "north");
+        assertEquals(2.236068, moveCommand.getDistance(n -> true), 0.0001, "distance");
     }
 
@@ -84,11 +84,11 @@
      */
     @Test
-    public void testSingleMove() {
+    void testSingleMove() {
         MoveCommand command = new MoveCommand(testData.existingNode, 1, 2);
         testData.existingNode.setEastNorth(new EastNorth(3, 7));
         command.executeCommand();
-        assertEquals("east", 4, testData.existingNode.getEastNorth().east(), 0.0001);
-        assertEquals("north", 9, testData.existingNode.getEastNorth().north(), 0.0001);
-        assertEquals("distance", 2.236068, command.getDistance(n -> true), 0.0001);
+        assertEquals(4, testData.existingNode.getEastNorth().east(), 0.0001, "east");
+        assertEquals(9, testData.existingNode.getEastNorth().north(), 0.0001, "north");
+        assertEquals(2.236068, command.getDistance(n -> true), 0.0001, "distance");
     }
 
@@ -97,5 +97,5 @@
      */
     @Test
-    public void testMultipleMove() {
+    void testMultipleMove() {
         MoveCommand command = new MoveCommand(
                 Arrays.asList(testData.existingNode, testData.existingNode2, testData.existingWay),
@@ -106,8 +106,8 @@
         command.executeCommand();
 
-        assertEquals("east", 4, testData.existingNode.getEastNorth().east(), 0.0001);
-        assertEquals("north", 9, testData.existingNode.getEastNorth().north(), 0.0001);
-        assertEquals("east", 5, testData.existingNode2.getEastNorth().east(), 0.0001);
-        assertEquals("north", 9, testData.existingNode2.getEastNorth().north(), 0.0001);
+        assertEquals(4, testData.existingNode.getEastNorth().east(), 0.0001, "east");
+        assertEquals(9, testData.existingNode.getEastNorth().north(), 0.0001, "north");
+        assertEquals(5, testData.existingNode2.getEastNorth().east(), 0.0001, "east");
+        assertEquals(9, testData.existingNode2.getEastNorth().north(), 0.0001, "north");
     }
 
@@ -116,20 +116,20 @@
      */
     @Test
-    public void testMoveAgain() {
+    void testMoveAgain() {
         MoveCommand command = new MoveCommand(testData.existingNode, 1, 2);
-        assertEquals("east", 1, command.getOffset().east(), 0.0001);
-        assertEquals("north", 2, command.getOffset().north(), 0.0001);
+        assertEquals(1, command.getOffset().east(), 0.0001, "east");
+        assertEquals(2, command.getOffset().north(), 0.0001, "north");
 
         command.moveAgain(1, 2);
-        assertEquals("east", 2, command.getOffset().east(), 0.0001);
-        assertEquals("north", 4, command.getOffset().north(), 0.0001);
+        assertEquals(2, command.getOffset().east(), 0.0001, "east");
+        assertEquals(4, command.getOffset().north(), 0.0001, "north");
 
         command.moveAgain(-9, -3);
-        assertEquals("east", -7, command.getOffset().east(), 0.0001);
-        assertEquals("north", 1, command.getOffset().north(), 0.0001);
+        assertEquals(-7, command.getOffset().east(), 0.0001, "east");
+        assertEquals(1, command.getOffset().north(), 0.0001, "north");
 
         command.moveAgainTo(1, 2);
-        assertEquals("east", 1, command.getOffset().east(), 0.0001);
-        assertEquals("north", 2, command.getOffset().north(), 0.0001);
+        assertEquals(1, command.getOffset().east(), 0.0001, "east");
+        assertEquals(2, command.getOffset().north(), 0.0001, "north");
     }
 
@@ -138,17 +138,17 @@
      */
     @Test
-    public void testCheckpoint() {
+    void testCheckpoint() {
         MoveCommand command = new MoveCommand(testData.existingNode, 2, 4);
-        assertEquals("east", 2, command.getOffset().east(), 0.0001);
-        assertEquals("north", 4, command.getOffset().north(), 0.0001);
+        assertEquals(2, command.getOffset().east(), 0.0001, "east");
+        assertEquals(4, command.getOffset().north(), 0.0001, "north");
 
         command.saveCheckpoint();
         command.moveAgain(3, 7);
-        assertEquals("east", 5, command.getOffset().east(), 0.0001);
-        assertEquals("north", 11, command.getOffset().north(), 0.0001);
+        assertEquals(5, command.getOffset().east(), 0.0001, "east");
+        assertEquals(11, command.getOffset().north(), 0.0001, "north");
 
         command.resetToCheckpoint();
-        assertEquals("east", 2, command.getOffset().east(), 0.0001);
-        assertEquals("north", 4, command.getOffset().north(), 0.0001);
+        assertEquals(2, command.getOffset().east(), 0.0001, "east");
+        assertEquals(4, command.getOffset().north(), 0.0001, "north");
     }
 
@@ -157,19 +157,19 @@
      */
     @Test
-    public void testStartPoint() {
+    void testStartPoint() {
         EastNorth start = new EastNorth(10, 20);
         MoveCommand command = new MoveCommand(testData.existingNode, start, start.add(1, 2));
-        assertEquals("east", 1, command.getOffset().east(), 0.0001);
-        assertEquals("north", 2, command.getOffset().north(), 0.0001);
+        assertEquals(1, command.getOffset().east(), 0.0001, "east");
+        assertEquals(2, command.getOffset().north(), 0.0001, "north");
 
         command.applyVectorTo(start.add(3, 4));
-        assertEquals("east", 3, command.getOffset().east(), 0.0001);
-        assertEquals("north", 4, command.getOffset().north(), 0.0001);
+        assertEquals(3, command.getOffset().east(), 0.0001, "east");
+        assertEquals(4, command.getOffset().north(), 0.0001, "north");
 
         // set to 100, 200
         command.changeStartPoint(new EastNorth(103, 204));
         command.applyVectorTo(new EastNorth(101, 202));
-        assertEquals("east", 1, command.getOffset().east(), 0.0001);
-        assertEquals("north", 2, command.getOffset().north(), 0.0001);
+        assertEquals(1, command.getOffset().east(), 0.0001, "east");
+        assertEquals(2, command.getOffset().north(), 0.0001, "north");
     }
 
@@ -178,10 +178,10 @@
      */
     @Test
-    public void testNoStartPoint() {
+    void testNoStartPoint() {
         MoveCommand command = new MoveCommand(testData.existingNode, 1, 0);
         // ignored
         command.applyVectorTo(new EastNorth(3, 4));
-        assertEquals("east", 1, command.getOffset().east(), 0.0001);
-        assertEquals("north", 0, command.getOffset().north(), 0.0001);
+        assertEquals(1, command.getOffset().east(), 0.0001, "east");
+        assertEquals(0, command.getOffset().north(), 0.0001, "north");
 
         // set to 100, 200
@@ -189,6 +189,6 @@
         // works
         command.applyVectorTo(new EastNorth(101, 202));
-        assertEquals("east", 1, command.getOffset().east(), 0.0001);
-        assertEquals("north", 2, command.getOffset().north(), 0.0001);
+        assertEquals(1, command.getOffset().east(), 0.0001, "east");
+        assertEquals(2, command.getOffset().north(), 0.0001, "north");
     }
 
@@ -197,18 +197,18 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         testData.existingNode.setEastNorth(new EastNorth(3, 7));
         MoveCommand command = new MoveCommand(testData.existingNode, 1, 2);
         command.executeCommand();
-        assertEquals("east", 4, testData.existingNode.getEastNorth().east(), 0.0001);
-        assertEquals("north", 9, testData.existingNode.getEastNorth().north(), 0.0001);
+        assertEquals(4, testData.existingNode.getEastNorth().east(), 0.0001, "east");
+        assertEquals(9, testData.existingNode.getEastNorth().north(), 0.0001, "north");
 
         command.undoCommand();
-        assertEquals("east", 3, testData.existingNode.getEastNorth().east(), 0.0001);
-        assertEquals("north", 7, testData.existingNode.getEastNorth().north(), 0.0001);
-
-        command.executeCommand();
-        assertEquals("east", 4, testData.existingNode.getEastNorth().east(), 0.0001);
-        assertEquals("north", 9, testData.existingNode.getEastNorth().north(), 0.0001);
+        assertEquals(3, testData.existingNode.getEastNorth().east(), 0.0001, "east");
+        assertEquals(7, testData.existingNode.getEastNorth().north(), 0.0001, "north");
+
+        command.executeCommand();
+        assertEquals(4, testData.existingNode.getEastNorth().east(), 0.0001, "east");
+        assertEquals(9, testData.existingNode.getEastNorth().north(), 0.0001, "north");
     }
 
@@ -217,5 +217,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -232,5 +232,5 @@
      */
     @Test
-    public void testGetParticipatingPrimitives() {
+    void testGetParticipatingPrimitives() {
         MoveCommand command = new MoveCommand(Arrays.<OsmPrimitive>asList(testData.existingNode), 1, 2);
         command.executeCommand();
@@ -248,5 +248,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         Node node = TestUtils.addFakeDataSet(new Node(LatLon.ZERO));
         node.put("name", "xy");
@@ -261,5 +261,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(MoveCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/PurgeCommandTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+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.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
@@ -13,7 +13,7 @@
 import java.util.List;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -37,9 +37,9 @@
  * Unit tests of {@link PurgeCommand} class.
  */
-public class PurgeCommandTest {
+class PurgeCommandTest {
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -49,5 +49,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestDataWithRelation();
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testExecute() {
+    void testExecute() {
         Relation relationParent = testData.createRelation(100, new RelationMember("child", testData.existingRelation));
         Relation relationParent2 = testData.createRelation(101, new RelationMember("child", testData.existingRelation));
@@ -83,5 +83,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         PurgeCommand command = new PurgeCommand(testData.layer.getDataSet(),
                 Arrays.<OsmPrimitive>asList(testData.existingNode, testData.existingWay),
@@ -104,5 +104,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -121,5 +121,5 @@
      */
     @Test
-    public void testGetParticipatingPrimitives() {
+    void testGetParticipatingPrimitives() {
         PurgeCommand command = new PurgeCommand(testData.layer.getDataSet(), Arrays.<OsmPrimitive>asList(testData.existingNode),
                 Arrays.<OsmPrimitive>asList(testData.existingRelation));
@@ -131,5 +131,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         List<OsmPrimitive> shortList = Arrays.<OsmPrimitive>asList(testData.existingWay);
         assertTrue(new PurgeCommand(testData.layer.getDataSet(), shortList, Arrays.<OsmPrimitive>asList()).getDescriptionText()
@@ -145,5 +145,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(PurgeCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/RemoveNodesCommandTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.Collections;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -28,10 +28,10 @@
  * Unit tests of {@link RemoveNodesCommand} class.
  */
-public class RemoveNodesCommandTest {
+class RemoveNodesCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -41,5 +41,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestDataWithRelation();
@@ -50,5 +50,5 @@
      */
     @Test
-    public void testExecute() {
+    void testExecute() {
         RemoveNodesCommand command = new RemoveNodesCommand(testData.existingWay,
                 Collections.singleton(testData.existingNode));
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         RemoveNodesCommand command = new RemoveNodesCommand(testData.existingWay,
                 Collections.singleton(testData.existingNode));
@@ -87,5 +87,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -103,5 +103,5 @@
      */
     @Test
-    public void testGetParticipatingPrimitives() {
+    void testGetParticipatingPrimitives() {
         RemoveNodesCommand command = new RemoveNodesCommand(testData.existingWay,
                 Collections.singleton(testData.existingNode));
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         assertTrue(new RemoveNodesCommand(testData.existingWay, Collections.singleton(testData.existingNode))
                 .getDescriptionText().matches("Removed nodes from .*"));
@@ -123,5 +123,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(RemoveNodesCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/RotateCommandTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -29,10 +29,10 @@
  * Unit tests of {@link RotateCommand} class.
  */
-public class RotateCommandTest {
+class RotateCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
@@ -42,5 +42,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestData();
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testRotate() {
+    void testRotate() {
         // pivot needs to be at 0,0
         Node n1 = new Node(new EastNorth(10, 10));
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         Node n1 = new Node(new EastNorth(10, 10));
         Node n2 = new Node(new EastNorth(-1, 0));
@@ -96,5 +96,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -113,5 +113,5 @@
      */
     @Test
-    public void testGetParticipatingPrimitives() {
+    void testGetParticipatingPrimitives() {
         RotateCommand command = new RotateCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0));
         command.executeCommand();
@@ -123,5 +123,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         assertEquals("Rotate 1 node",
                 new RotateCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0))
@@ -136,5 +136,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(RotateCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/ScaleCommandTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -29,10 +29,10 @@
  * Unit tests of {@link ScaleCommand} class.
  */
-public class ScaleCommandTest {
+class ScaleCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
@@ -42,5 +42,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestData();
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testScale() {
+    void testScale() {
         // pivot needs to be at 0,0
         Node n1 = new Node(new EastNorth(10, 10));
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         Node n1 = new Node(new EastNorth(10, 10));
         Node n2 = new Node(new EastNorth(-1, 0));
@@ -96,5 +96,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -113,5 +113,5 @@
      */
     @Test
-    public void testGetParticipatingPrimitives() {
+    void testGetParticipatingPrimitives() {
         ScaleCommand command = new ScaleCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0));
         command.executeCommand();
@@ -123,5 +123,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         assertEquals("Scale 1 node",
                 new ScaleCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0))
@@ -136,5 +136,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ScaleCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java	(revision 17275)
@@ -2,7 +2,8 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.ArrayList;
@@ -10,7 +11,7 @@
 import java.util.List;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -28,10 +29,10 @@
  * Unit tests of {@link SelectCommand} class.
  */
-public class SelectCommandTest {
+class SelectCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -41,5 +42,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestDataWithRelation();
@@ -50,5 +51,5 @@
      */
     @Test
-    public void testExecute() {
+    void testExecute() {
         SelectCommand command = new SelectCommand(testData.layer.getDataSet(), Arrays.asList(testData.existingNode, testData.existingWay));
 
@@ -66,5 +67,5 @@
      */
     @Test
-    public void testExecuteAfterModify() {
+    void testExecuteAfterModify() {
         List<OsmPrimitive> list = new ArrayList<>(Arrays.asList(testData.existingNode, testData.existingWay));
         SelectCommand command = new SelectCommand(testData.layer.getDataSet(), list);
@@ -84,5 +85,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         SelectCommand command = new SelectCommand(testData.layer.getDataSet(), Arrays.asList(testData.existingNode, testData.existingWay));
         testData.layer.getDataSet().setSelected(Arrays.asList(testData.existingNode2));
@@ -107,5 +108,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         ArrayList<OsmPrimitive> modified = new ArrayList<>();
         ArrayList<OsmPrimitive> deleted = new ArrayList<>();
@@ -123,5 +124,5 @@
      */
     @Test
-    public void testGetParticipatingPrimitives() {
+    void testGetParticipatingPrimitives() {
         SelectCommand command = new SelectCommand(testData.layer.getDataSet(), Arrays.asList(testData.existingNode));
         command.executeCommand();
@@ -133,5 +134,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         DataSet ds = testData.layer.getDataSet();
         assertTrue(new SelectCommand(ds, Arrays.<OsmPrimitive>asList(testData.existingNode))
@@ -149,5 +150,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(SelectCommand.class).usingGetClass()
@@ -165,7 +166,7 @@
      * Unit test of {@link SelectCommand#SelectCommand}.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testConstructorIAE() {
-        new SelectCommand(new DataSet(), Arrays.asList(new OsmPrimitive[] {null}));
+    @Test
+    void testConstructorIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new SelectCommand(new DataSet(), Arrays.asList(new OsmPrimitive[] {null})));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.PrintWriter;
@@ -19,7 +19,7 @@
 import java.util.Collections;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -39,10 +39,10 @@
  * Unit tests of {@link SequenceCommand} class.
  */
-public class SequenceCommandTest {
+class SequenceCommandTest {
 
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -52,5 +52,5 @@
      * Set up the test data.
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         testData = new CommandTestDataWithRelation();
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testExecute() {
+    void testExecute() {
         DataSet ds = new DataSet();
         final TestCommand command1 = new TestCommand(ds, Arrays.<OsmPrimitive>asList(testData.existingNode));
@@ -83,5 +83,5 @@
      */
     @Test
-    public void testUndo() {
+    void testUndo() {
         DataSet ds = new DataSet();
         final TestCommand command2 = new TestCommand(ds, Arrays.<OsmPrimitive>asList(testData.existingNode2));
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testExecuteRollback() {
+    void testExecuteRollback() {
         DataSet ds = new DataSet();
         TestCommand command1 = new TestCommand(ds, null);
@@ -129,5 +129,5 @@
      */
     @Test
-    public void testContinueOnErrors() {
+    void testContinueOnErrors() {
         DataSet ds = new DataSet();
         TestCommand command1 = new TestCommand(ds, null);
@@ -148,5 +148,5 @@
      */
     @Test
-    public void testGetLastCommand() {
+    void testGetLastCommand() {
         DataSet ds = new DataSet();
         final TestCommand command1 = new TestCommand(ds, Arrays.<OsmPrimitive>asList(testData.existingNode));
@@ -161,5 +161,5 @@
      */
     @Test
-    public void testFillModifiedData() {
+    void testFillModifiedData() {
         DataSet ds = new DataSet();
         Command command1 = new TestCommand(ds, Arrays.<OsmPrimitive>asList(testData.existingNode));
@@ -194,5 +194,5 @@
      */
     @Test
-    public void testGetParticipatingPrimitives() {
+    void testGetParticipatingPrimitives() {
         DataSet ds = new DataSet();
         Command command1 = new TestCommand(ds, Arrays.<OsmPrimitive>asList(testData.existingNode));
@@ -211,5 +211,5 @@
      */
     @Test
-    public void testDescription() {
+    void testDescription() {
         assertTrue(new SequenceCommand(new DataSet(), "test", Collections.emptyList(), false).getDescriptionText().matches("Sequence: test"));
     }
@@ -219,5 +219,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         DataSet ds = new DataSet();
         TestUtils.assumeWorkingEqualsVerifier();
@@ -263,5 +263,5 @@
         @Override
         public boolean executeCommand() {
-            assertFalse("Cannot execute twice", executed);
+            assertFalse(executed, "Cannot execute twice");
             executed = true;
             return true;
@@ -270,5 +270,5 @@
         @Override
         public void undoCommand() {
-            assertTrue("Cannot undo without execute", executed);
+            assertTrue(executed, "Cannot undo without execute");
             executed = false;
         }
@@ -295,5 +295,5 @@
         @Override
         public void undoCommand() {
-            assertTrue("Cannot undo without execute", executed);
+            assertTrue(executed, "Cannot undo without execute");
             executed = false;
         }
@@ -309,5 +309,5 @@
      */
     @Test
-    public void testWrapIfNeeded() {
+    void testWrapIfNeeded() {
         DataSet ds = new DataSet();
         TestCommand command1 = new TestCommand(ds, Collections.<OsmPrimitive>singletonList(testData.existingNode));
@@ -322,5 +322,5 @@
      */
     @Test
-    public void testCreateReportedException() {
+    void testCreateReportedException() {
         DataSet ds = new DataSet();
         Command c1 = new TestCommand(ds, Collections.emptyList()) {
Index: trunk/test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/SplitWayCommandTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.command;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -14,6 +14,6 @@
 import java.util.Optional;
 
-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.TestUtils;
 import org.openstreetmap.josm.command.SplitWayCommand.Strategy;
@@ -36,10 +36,10 @@
  * Unit tests for class {@link SplitWayCommand}.
  */
-public final class SplitWayCommandTest {
+final class SplitWayCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection().preferences();
@@ -49,5 +49,5 @@
      */
     @Test
-    public void testFindVias() {
+    void testFindVias() {
         // empty relation
         assertTrue(SplitWayCommand.findVias(new Relation(), null).isEmpty());
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testRouteRelation() {
+    void testRouteRelation() {
         doTestRouteRelation(false, 0);
         doTestRouteRelation(false, 1);
@@ -149,5 +149,5 @@
 
     @Test
-    public void testOneMemberOrderedRelationShowsWarningTest() {
+    void testOneMemberOrderedRelationShowsWarningTest() {
         final DataSet dataSet = new DataSet();
 
@@ -188,5 +188,5 @@
 
     @Test
-    public void testDoIncompleteMembersOrderedRelationCorrectOrderTest() {
+    void testDoIncompleteMembersOrderedRelationCorrectOrderTest() {
         for (int i = 0; i < 2; i++) {
             // All these permutations should result in a split that keeps the new parts in order.
@@ -244,5 +244,6 @@
 
     static void assertFirstLastNodeIs(Way way, Node node) {
-        assertTrue("First/last node of " + way + " should be " + node, node.equals(way.firstNode()) || node.equals(way.lastNode()));
+        assertTrue(node.equals(way.firstNode()) || node.equals(way.lastNode()),
+                "First/last node of " + way + " should be " + node);
     }
 
@@ -253,6 +254,6 @@
         Node last2 = two.lastNode();
 
-        assertTrue("Ways expected to be connected at their ends.",
-                first1 == first2 || first1 == last2 || last1 == first2 || last1 == last2);
+        assertTrue(first1 == first2 || first1 == last2 || last1 == first2 || last1 == last2,
+                "Ways expected to be connected at their ends.");
     }
 
@@ -263,5 +264,5 @@
      */
     @Test
-    public void testTicket18596() throws IOException, IllegalDataException {
+    void testTicket18596() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18596, "data.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -280,5 +281,5 @@
             Relation relation = (Relation) ds.getPrimitiveById(8888, OsmPrimitiveType.RELATION);
 
-            assertEquals(relation.getMembersCount(), 8);
+            assertEquals(8, relation.getMembersCount());
 
             // Before the patch introduced in #18596, these asserts would fail. The two parts of
@@ -299,5 +300,5 @@
      */
     @Test
-    public void testTicket17400() throws IOException, IllegalDataException {
+    void testTicket17400() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(17400, "data.osm")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -323,5 +324,5 @@
 
             // One more than the original 161.
-            assertEquals(relation.getMembersCount(), 162);
+            assertEquals(162, relation.getMembersCount());
 
             // Before the patch introduced in #18596, these asserts would fail. The new parts of
@@ -347,5 +348,5 @@
      */
     @Test
-    public void testTicket18863() throws IOException, IllegalDataException {
+    void testTicket18863() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(18863, "data.osm.bz2")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
@@ -375,5 +376,5 @@
      */
     @Test
-    public void testTicket19432() throws IOException, IllegalDataException {
+    void testTicket19432() throws IOException, IllegalDataException {
         try (InputStream is = TestUtils.getRegressionDataStream(19432, "josm_split_way_exception_example.osm.bz2")) {
             DataSet ds = OsmReader.parseDataSet(is, null);
Index: trunk/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -18,10 +18,10 @@
  * Unit tests of {@link TransformNodesCommand} class.
  */
-public class TransformNodesCommandTest {
+class TransformNodesCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(TransformNodesCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.command.conflict;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -26,10 +26,10 @@
  * Unit tests of {@link ConflictAddCommand} class.
  */
-public class ConflictAddCommandTest {
+class ConflictAddCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -39,5 +39,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         testData = new CommandTestData();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testExecuteUndoCommand() {
+    void testExecuteUndoCommand() {
         DataSet ds = testData.layer.getDataSet();
         Conflict<Node> conflict = new Conflict<>(testData.existingNode, testData.existingNode2);
@@ -64,5 +64,5 @@
      */
     @Test
-    public void testGetDescriptionIcon() {
+    void testGetDescriptionIcon() {
         Conflict<Node> conflict = new Conflict<>(testData.existingNode, testData.existingNode2);
         assertNotNull(new ConflictAddCommand(testData.layer.getDataSet(), conflict).getDescriptionIcon());
@@ -73,5 +73,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ConflictAddCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictResolveCommandTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command.conflict;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.conflict.Conflict;
@@ -19,10 +19,10 @@
  * Unit tests of {@link ConflictResolveCommand} class.
  */
-public class ConflictResolveCommandTest {
+class ConflictResolveCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ConflictResolveCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.command.conflict;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -28,5 +28,5 @@
  * Unit tests of {@link CoordinateConflictResolveCommand} class.
  */
-public class CoordinateConflictResolveCommandTest {
+class CoordinateConflictResolveCommandTest {
 
     private CommandTestData testData;
@@ -35,5 +35,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -42,5 +42,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         testData = new CommandTestData();
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testExecuteKeepMineUndoCommand() {
+    void testExecuteKeepMineUndoCommand() {
         Conflict<Node> conflict = createConflict();
         CoordinateConflictResolveCommand cmd = new CoordinateConflictResolveCommand(conflict, MergeDecisionType.KEEP_MINE);
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testExecuteKeepTheirUndoCommand() {
+    void testExecuteKeepTheirUndoCommand() {
         Conflict<Node> conflict = createConflict();
         CoordinateConflictResolveCommand cmd = new CoordinateConflictResolveCommand(conflict, MergeDecisionType.KEEP_THEIR);
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testGetDescriptionIcon() {
+    void testGetDescriptionIcon() {
         Conflict<Node> conflict = createConflict();
         assertNotNull(new CoordinateConflictResolveCommand(conflict, null).getDescriptionIcon());
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(CoordinateConflictResolveCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommandTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command.conflict;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.conflict.Conflict;
@@ -20,10 +20,10 @@
  * Unit tests of {@link DeletedStateConflictResolveCommand} class.
  */
-public class DeletedStateConflictResolveCommandTest {
+class DeletedStateConflictResolveCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(DeletedStateConflictResolveCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommandTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command.conflict;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.conflict.Conflict;
@@ -20,10 +20,10 @@
  * Unit tests of {@link ModifiedConflictResolveCommand} class.
  */
-public class ModifiedConflictResolveCommandTest {
+class ModifiedConflictResolveCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ModifiedConflictResolveCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommandTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command.conflict;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.conflict.Conflict;
@@ -20,10 +20,10 @@
  * Unit tests of {@link RelationMemberConflictResolverCommand} class.
  */
-public class RelationMemberConflictResolverCommandTest {
+class RelationMemberConflictResolverCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(RelationMemberConflictResolverCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command.conflict;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.conflict.Conflict;
@@ -20,10 +20,10 @@
  * Unit tests of {@link TagConflictResolveCommand} class.
  */
-public class TagConflictResolveCommandTest {
+class TagConflictResolveCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(TagConflictResolveCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommandTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command.conflict;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.conflict.Conflict;
@@ -20,10 +20,10 @@
  * Unit tests of {@link VersionConflictResolveCommand} class.
  */
-public class VersionConflictResolveCommandTest {
+class VersionConflictResolveCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(VersionConflictResolveCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommandTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.command.conflict;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.conflict.Conflict;
@@ -20,10 +20,10 @@
  * Unit tests of {@link WayNodesConflictResolverCommand} class.
  */
-public class WayNodesConflictResolverCommandTest {
+class WayNodesConflictResolverCommandTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(WayNodesConflictResolverCommand.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/data/APIDataSetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/APIDataSetTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/APIDataSetTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.data;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.conflict.ConflictCollection;
 import org.openstreetmap.josm.data.osm.CyclicUploadDependencyException;
@@ -26,15 +26,15 @@
  * Unit tests for class {@link APIDataSet}.
  */
-public class APIDataSetTest {
+class APIDataSetTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
 
     @Test
-    public void testOneNewRelationOnly() throws CyclicUploadDependencyException {
+    void testOneNewRelationOnly() throws CyclicUploadDependencyException {
         Relation r = new Relation();
         r.put("name", "r1");
@@ -52,5 +52,5 @@
 
     @Test
-    public void testNewParentChildPair() throws CyclicUploadDependencyException {
+    void testNewParentChildPair() throws CyclicUploadDependencyException {
         DataSet ds = new DataSet();
         Relation r1 = new Relation();
@@ -75,5 +75,5 @@
 
     @Test
-    public void testOneExistingAndThreNewInAChain() throws CyclicUploadDependencyException {
+    void testOneExistingAndThreNewInAChain() throws CyclicUploadDependencyException {
         DataSet ds = new DataSet();
 
@@ -121,5 +121,5 @@
 
     @Test
-    public void testOneParentTwoNewChildren() throws CyclicUploadDependencyException {
+    void testOneParentTwoNewChildren() throws CyclicUploadDependencyException {
         DataSet ds = new DataSet();
         Relation r1 = new Relation();
@@ -150,5 +150,5 @@
 
     @Test // for ticket #9624
-    public void testDeleteOneParentTwoNewChildren() throws CyclicUploadDependencyException {
+    void testDeleteOneParentTwoNewChildren() throws CyclicUploadDependencyException {
         DataSet ds = new DataSet();
         Relation r1 = new Relation(1);
@@ -193,5 +193,5 @@
 
     @Test // for ticket #9656
-    public void testDeleteWay() throws CyclicUploadDependencyException {
+    void testDeleteWay() throws CyclicUploadDependencyException {
         DataSet ds = new DataSet();
         final Way way = new Way(1, 2);
@@ -230,5 +230,5 @@
 
     @Test
-    public void testOneCycle() {
+    void testOneCycle() {
         DataSet ds = new DataSet();
         Relation r1 = new Relation();
Index: trunk/test/unit/org/openstreetmap/josm/data/BoundsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/BoundsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/BoundsTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.geom.Rectangle2D;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 
@@ -14,8 +14,8 @@
  * Unit tests for class {@link Bounds}.
  */
-public class BoundsTest {
+class BoundsTest {
 
     @Test
-    public void testCrossing() {
+    void testCrossing() {
         Bounds b1 = new Bounds(0, 170, 50, -170);
         assertTrue(b1.crosses180thMeridian());
@@ -70,5 +70,5 @@
      */
     @Test
-    public void testConstructorNominalCases() {
+    void testConstructorNominalCases() {
         doTestConstructorNominal(new Bounds(new LatLon(1d, 2d), new LatLon(3d, 4d)));
         doTestConstructorNominal(new Bounds(new LatLon(1d, 2d), new LatLon(3d, 4d), true));
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testConstructorSinglePointCases() {
+    void testConstructorSinglePointCases() {
         doTestConstructorPoint(new Bounds(new LatLon(1d, 2d)));
         doTestConstructorPoint(new Bounds(new LatLon(1d, 2d), true));
Index: trunk/test/unit/org/openstreetmap/josm/data/ImageDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/ImageDataTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/ImageDataTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
@@ -12,5 +12,5 @@
 import java.util.List;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.ImageData.ImageDataUpdateListener;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -26,5 +26,5 @@
  * Unit tests for class {@link ImageData}.
  */
-public class ImageDataTest {
+class ImageDataTest {
 
     private static List<ImageEntry> getOneImage() {
@@ -35,5 +35,5 @@
 
     @Test
-    public void testWithNullData() {
+    void testWithNullData() {
         ImageData data = new ImageData();
         assertEquals(0, data.getImages().size());
@@ -53,10 +53,10 @@
 
     @Test
-    public void testImageEntryWithImages() {
+    void testImageEntryWithImages() {
         assertEquals(1, new ImageData(getOneImage()).getImages().size());
     }
 
     @Test
-    public void testSortData(@Mocked Collections ignore) {
+    void testSortData(@Mocked Collections ignore) {
         List<ImageEntry> list = getOneImage();
 
@@ -69,10 +69,10 @@
 
     @Test
-    public void testIsModifiedFalse() {
+    void testIsModifiedFalse() {
         assertFalse(new ImageData(getOneImage()).isModified());
     }
 
     @Test
-    public void testIsModifiedTrue() {
+    void testIsModifiedTrue() {
         List<ImageEntry> list = getOneImage();
 
@@ -85,15 +85,15 @@
 
     @Test
-    public void testSelectFirstImage() {
-        List<ImageEntry> list = getOneImage();
-
-        ImageData data = new ImageData(list);
-        data.selectFirstImage();
-        assertEquals(1, data.getSelectedImages().size());
-        assertEquals(list.get(0), data.getSelectedImages().get(0));
-    }
-
-    @Test
-    public void testSelectLastImage() {
+    void testSelectFirstImage() {
+        List<ImageEntry> list = getOneImage();
+
+        ImageData data = new ImageData(list);
+        data.selectFirstImage();
+        assertEquals(1, data.getSelectedImages().size());
+        assertEquals(list.get(0), data.getSelectedImages().get(0));
+    }
+
+    @Test
+    void testSelectLastImage() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -106,5 +106,5 @@
 
     @Test
-    public void testSelectNextImage() {
+    void testSelectNextImage() {
         List<ImageEntry> list = getOneImage();
 
@@ -120,5 +120,5 @@
 
     @Test
-    public void testSelectPreviousImage() {
+    void testSelectPreviousImage() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -136,5 +136,5 @@
 
     @Test
-    public void testSetSelectedImage() {
+    void testSetSelectedImage() {
         List<ImageEntry> list = getOneImage();
 
@@ -146,5 +146,5 @@
 
     @Test
-    public void testClearSelectedImages() {
+    void testClearSelectedImages() {
         List<ImageEntry> list = getOneImage();
 
@@ -156,5 +156,5 @@
 
     @Test
-    public void testSelectionListener() {
+    void testSelectionListener() {
         List<ImageEntry> list = getOneImage();
         ImageData data = new ImageData(list);
@@ -175,5 +175,5 @@
 
     @Test
-    public void testRemoveSelectedImage() {
+    void testRemoveSelectedImage() {
         List<ImageEntry> list = getOneImage();
         ImageData data = new ImageData(list);
@@ -185,5 +185,5 @@
 
     @Test
-    public void testRemoveSelectedImages() {
+    void testRemoveSelectedImages() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -198,5 +198,5 @@
 
     @Test
-    public void testRemoveSelectedImagesWithRemainingImages() {
+    void testRemoveSelectedImagesWithRemainingImages() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -212,5 +212,5 @@
 
     @Test
-    public void testSelectImageAfterRemove() {
+    void testSelectImageAfterRemove() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -225,5 +225,5 @@
 
     @Test
-    public void testSelectImageAfterRemoveWhenTheLastIsSelected() {
+    void testSelectImageAfterRemoveWhenTheLastIsSelected() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -238,5 +238,5 @@
 
     @Test
-    public void testRemoveSelectedImageTriggerListener() {
+    void testRemoveSelectedImageTriggerListener() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -258,5 +258,5 @@
 
     @Test
-    public void testRemoveSelectedImagesTriggerListener() {
+    void testRemoveSelectedImagesTriggerListener() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -278,5 +278,5 @@
 
     @Test
-    public void testRemoveImageAndTriggerListener() {
+    void testRemoveImageAndTriggerListener() {
         List<ImageEntry> list = getOneImage();
         ImageData data = new ImageData(list);
@@ -297,5 +297,5 @@
 
     @Test
-    public void testMergeFrom() {
+    void testMergeFrom() {
         ImageEntry image = new ImageEntry(new File("test2"));
         List<ImageEntry> list1 = getOneImage();
@@ -323,5 +323,5 @@
 
     @Test
-    public void testMergeFromSelectedImage() {
+    void testMergeFromSelectedImage() {
         ImageEntry image = new ImageEntry(new File("test2"));
         List<ImageEntry> list1 = getOneImage();
@@ -340,5 +340,5 @@
 
     @Test
-    public void testAddImageToSelection() {
+    void testAddImageToSelection() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry(new File("test2")));
@@ -353,5 +353,5 @@
 
     @Test
-    public void testRemoveImageToSelection() {
+    void testRemoveImageToSelection() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -366,5 +366,5 @@
 
     @Test
-    public void testIsSelected() {
+    void testIsSelected() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry(new File("test2")));
@@ -381,5 +381,5 @@
 
     @Test
-    public void testActionsWithMultipleImagesSelected() {
+    void testActionsWithMultipleImagesSelected() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry(new File("test2")));
@@ -402,5 +402,5 @@
 
     @Test
-    public void testTriggerListenerWhenNewImageIsSelectedAndRemoved() {
+    void testTriggerListenerWhenNewImageIsSelectedAndRemoved() {
         List<ImageEntry> list = getOneImage();
         list.add(new ImageEntry());
@@ -423,5 +423,5 @@
 
     @Test
-    public void testUpdatePosition() {
+    void testUpdatePosition() {
         List<ImageEntry> list = getOneImage();
         ImageData data = new ImageData(list);
@@ -435,5 +435,5 @@
 
     @Test
-    public void testUpdateDirection() {
+    void testUpdateDirection() {
         List<ImageEntry> list = getOneImage();
         ImageData data = new ImageData(list);
@@ -447,5 +447,5 @@
 
     @Test
-    public void testTriggerListenerOnUpdate() {
+    void testTriggerListenerOnUpdate() {
         List<ImageEntry> list = getOneImage();
         ImageData data = new ImageData(list);
@@ -467,5 +467,5 @@
 
     @Test
-    public void testManuallyTriggerUpdateListener() {
+    void testManuallyTriggerUpdateListener() {
         List<ImageEntry> list = getOneImage();
         ImageData data = new ImageData(list);
Index: trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link Preferences}.
  */
-public class PreferencesTest {
+class PreferencesTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToXml() {
+    void testToXml() {
         assertEquals(String.format(
             "<?xml version=\"1.0\" encoding=\"UTF-8\"?>%n" +
Index: trunk/test/unit/org/openstreetmap/josm/data/PreferencesUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/PreferencesUtilsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/PreferencesUtilsTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.data;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
 
@@ -15,10 +15,10 @@
  * Unit tests for class {@link PreferencesUtils}.
  */
-public class PreferencesUtilsTest {
+class PreferencesUtilsTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         PreferencesUtils.resetLog();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testLog() {
+    void testLog() {
         assertEquals("", PreferencesUtils.getLog());
         PreferencesUtils.log("test");
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(PreferencesUtils.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/ProjectionBoundsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/ProjectionBoundsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/ProjectionBoundsTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.data;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests for class {@link ProjectionBounds}.
  */
-public class ProjectionBoundsTest {
+class ProjectionBoundsTest {
 
     /**
@@ -15,5 +15,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("ProjectionBounds[1.0,2.0,3.0,4.0]", new ProjectionBounds(1, 2, 3, 4).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java	(revision 17275)
@@ -2,13 +2,14 @@
 package org.openstreetmap.josm.data;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Rule;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+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.osm.User;
 import org.openstreetmap.josm.data.osm.UserInfo;
@@ -21,10 +22,10 @@
  * Unit tests of {@link UserIdentityManager} class.
  */
-public class UserIdentityManagerTest {
+class UserIdentityManagerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -45,5 +46,5 @@
      */
     @Test
-    public void testSingletonAccess() {
+    void testSingletonAccess() {
 
         UserIdentityManager im = UserIdentityManager.getInstance();
@@ -62,5 +63,5 @@
      */
     @Test
-    public void testSetAnonymous() {
+    void testSetAnonymous() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
@@ -82,5 +83,5 @@
      */
     @Test
-    public void testSetPartiallyIdentified() {
+    void testSetPartiallyIdentified() {
         UserIdentityManager im = UserIdentityManager.getInstance();
         im.setPartiallyIdentified("test");
@@ -101,8 +102,8 @@
      * Unit test of {@link UserIdentityManager#setPartiallyIdentified} - null case.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS")
-    public void testSetPartiallyIdentifiedNull() {
-        UserIdentityManager.getInstance().setPartiallyIdentified(null);
+    void testSetPartiallyIdentifiedNull() {
+        assertThrows(IllegalArgumentException.class, () -> UserIdentityManager.getInstance().setPartiallyIdentified(null));
     }
 
@@ -110,7 +111,7 @@
      * Unit test of {@link UserIdentityManager#setPartiallyIdentified} - empty case.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testSetPartiallyIdentifiedEmpty() {
-        UserIdentityManager.getInstance().setPartiallyIdentified("");
+    @Test
+    void testSetPartiallyIdentifiedEmpty() {
+        assertThrows(IllegalArgumentException.class, () -> UserIdentityManager.getInstance().setPartiallyIdentified(""));
     }
 
@@ -118,7 +119,7 @@
      * Unit test of {@link UserIdentityManager#setPartiallyIdentified} - blank case.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testSetPartiallyIdentifiedBlank() {
-        UserIdentityManager.getInstance().setPartiallyIdentified("  \t  ");
+    @Test
+    void testSetPartiallyIdentifiedBlank() {
+        assertThrows(IllegalArgumentException.class, () -> UserIdentityManager.getInstance().setPartiallyIdentified("  \t  "));
     }
 
@@ -127,5 +128,5 @@
      */
     @Test
-    public void testSetFullyIdentified() {
+    void testSetFullyIdentified() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
@@ -149,8 +150,8 @@
      * Unit test of {@link UserIdentityManager#setFullyIdentified} - null name case.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS")
-    public void testSetFullyIdentifiedNullName() {
-        UserIdentityManager.getInstance().setFullyIdentified(null, newUserInfo());
+    void testSetFullyIdentifiedNullName() {
+        assertThrows(IllegalArgumentException.class, () -> UserIdentityManager.getInstance().setFullyIdentified(null, newUserInfo()));
     }
 
@@ -158,7 +159,7 @@
      * Unit test of {@link UserIdentityManager#setFullyIdentified} - empty name case.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testSetFullyIdentifiedEmptyName() {
-        UserIdentityManager.getInstance().setFullyIdentified("", newUserInfo());
+    @Test
+    void testSetFullyIdentifiedEmptyName() {
+        assertThrows(IllegalArgumentException.class, () -> UserIdentityManager.getInstance().setFullyIdentified("", newUserInfo()));
     }
 
@@ -166,7 +167,7 @@
      * Unit test of {@link UserIdentityManager#setFullyIdentified} - blank name case.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testSetFullyIdentifiedBlankName() {
-        UserIdentityManager.getInstance().setFullyIdentified(" \t ", newUserInfo());
+    @Test
+    void testSetFullyIdentifiedBlankName() {
+        assertThrows(IllegalArgumentException.class, () -> UserIdentityManager.getInstance().setFullyIdentified(" \t ", newUserInfo()));
     }
 
@@ -174,7 +175,7 @@
      * Unit test of {@link UserIdentityManager#setFullyIdentified} - null info case.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testSetFullyIdentifiedNullInfo() {
-        UserIdentityManager.getInstance().setFullyIdentified("test", null);
+    @Test
+    void testSetFullyIdentifiedNullInfo() {
+        assertThrows(IllegalArgumentException.class, () -> UserIdentityManager.getInstance().setFullyIdentified("test", null));
     }
 
@@ -183,5 +184,5 @@
      */
     @Test
-    public void testInitFromPreferences1() {
+    void testInitFromPreferences1() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
@@ -208,5 +209,5 @@
      */
     @Test
-    public void testInitFromPreferences2() {
+    void testInitFromPreferences2() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
@@ -233,5 +234,5 @@
      */
     @Test
-    public void testInitFromPreferences3() {
+    void testInitFromPreferences3() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
@@ -260,5 +261,5 @@
      */
     @Test
-    public void testInitFromPreferences4() {
+    void testInitFromPreferences4() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
@@ -286,5 +287,5 @@
      */
     @Test
-    public void testInitFromPreferences5() {
+    void testInitFromPreferences5() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
@@ -307,5 +308,5 @@
 
     @Test
-    public void testApiUrlChanged() {
+    void testApiUrlChanged() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
@@ -344,5 +345,5 @@
 
     @Test
-    public void testUserNameChanged() {
+    void testUserNameChanged() {
         UserIdentityManager im = UserIdentityManager.getInstance();
 
Index: trunk/test/unit/org/openstreetmap/josm/data/VersionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/VersionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/VersionTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.data;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.nio.charset.StandardCharsets;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 
@@ -15,10 +15,10 @@
  * Unit tests for class {@link Version}.
  */
-public class VersionTest {
+class VersionTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -29,11 +29,11 @@
      */
     @Test
-    public void testGetAgentString() {
+    void testGetAgentString() {
         Version version = new Version();
         version.initFromRevisionInfo(null);
         String v = version.getAgentString(false);
-        assertTrue(v, v.matches("JOSM/1\\.5 \\(UNKNOWN en\\)"));
+        assertTrue(v.matches("JOSM/1\\.5 \\(UNKNOWN en\\)"), v);
         v = version.getAgentString(true);
-        assertTrue(v, v.matches("JOSM/1\\.5 \\(UNKNOWN en\\).*"));
+        assertTrue(v.matches("JOSM/1\\.5 \\(UNKNOWN en\\).*"), v);
     }
 
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testInitFromRevisionInfoNull() {
+    void testInitFromRevisionInfoNull() {
         Version v = new Version();
         v.initFromRevisionInfo(null);
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testInitFromRevisionInfoLocal() {
+    void testInitFromRevisionInfoLocal() {
         Version v = new Version();
         v.initFromRevisionInfo(new ByteArrayInputStream(("\n" +
Index: trunk/test/unit/org/openstreetmap/josm/data/cache/HostLimitQueueTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/cache/HostLimitQueueTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/cache/HostLimitQueueTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.cache;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -12,6 +12,6 @@
 
 import org.apache.commons.jcs3.access.behavior.ICacheAccess;
-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.data.imagery.TMSCachedTileLoader;
 import org.openstreetmap.josm.data.imagery.TileJobOptions;
@@ -25,9 +25,9 @@
  * @author Wiktor Niesiobedzki
  */
-public class HostLimitQueueTest {
+class HostLimitQueueTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20 * 1000);
@@ -79,5 +79,5 @@
      */
     @Test
-    public void testSingleThreadPerHost() throws Exception {
+    void testSingleThreadPerHost() throws Exception {
         ThreadPoolExecutor tpe = TMSCachedTileLoader.getNewThreadPoolExecutor("test-%d", 3, 1);
         ICacheAccess<String, CacheEntry> cache = JCSCacheManager.getCache("test", 3, 0, "");
@@ -96,6 +96,6 @@
         // so it should take ~8 seconds to finish
         // if it's shorter, it means that host limit does not work
-        assertTrue("Expected duration between 8 and 11 seconds not met. Actual duration: " + (duration /1000),
-                duration < 11*1000 & duration > 8*1000);
+        assertTrue(duration < 11*1000 & duration > 8*1000,
+                "Expected duration between 8 and 11 seconds not met. Actual duration: " + (duration /1000));
     }
 
@@ -105,5 +105,5 @@
      */
     @Test
-    public void testMultipleThreadPerHost() throws Exception {
+    void testMultipleThreadPerHost() throws Exception {
         ThreadPoolExecutor tpe = TMSCachedTileLoader.getNewThreadPoolExecutor("test-%d", 3, 2);
         ICacheAccess<String, CacheEntry> cache = JCSCacheManager.getCache("test", 3, 0, "");
@@ -121,6 +121,6 @@
         // so it should take ~5 seconds to finish
         // if it's shorter, it means that host limit does not work
-        assertTrue("Expected duration between 4 and 6 seconds not met. Actual duration: " + (duration /1000),
-                duration < 6*1000 & duration > 4*1000);
+        assertTrue(duration < 6*1000 & duration > 4*1000,
+                "Expected duration between 4 and 6 seconds not met. Actual duration: " + (duration /1000));
     }
 
@@ -130,5 +130,5 @@
      */
     @Test
-    public void testTwoHosts() throws Exception {
+    void testTwoHosts() throws Exception {
         ThreadPoolExecutor tpe = TMSCachedTileLoader.getNewThreadPoolExecutor("test-%d", 3, 1);
         ICacheAccess<String, CacheEntry> cache = JCSCacheManager.getCache("test", 3, 0, "");
@@ -147,6 +147,6 @@
         // so it should take ~5 seconds to finish
         // if it's shorter, it means that host limit does not work
-        assertTrue("Expected duration between 4 and 6 seconds not met. Actual duration: " + (duration /1000),
-                duration < 6*1000 & duration > 4*1000);
+        assertTrue(duration < 6*1000 & duration > 4*1000,
+                "Expected duration between 4 and 6 seconds not met. Actual duration: " + (duration /1000));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.data.cache;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.File;
@@ -11,6 +11,6 @@
 import org.apache.commons.jcs3.access.CacheAccess;
 import org.apache.commons.jcs3.auxiliary.disk.block.BlockDiskCacheAttributes;
-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.testutils.JOSMTestRules;
 
@@ -21,10 +21,10 @@
  * Unit tests for class {@link JCSCacheManager}.
  */
-public class JCSCacheManagerTest {
+class JCSCacheManagerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20000);
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(JCSCacheManager.class);
     }
@@ -44,5 +44,5 @@
      */
     @Test
-    public void testLoggingAdaptor12054() throws IOException {
+    void testLoggingAdaptor12054() throws IOException {
         JCSCacheManager.getCache("foobar", 1, 0, "foobar"); // cause logging adaptor to be initialized
         Logger.getLogger("org.apache.commons.jcs3").warning("{switch:0}");
@@ -50,5 +50,5 @@
 
     @Test
-    public void testUseBigDiskFile() throws IOException {
+    void testUseBigDiskFile() throws IOException {
         if (JCSCacheManager.USE_BLOCK_CACHE.get()) {
             // test only when using block cache
@@ -65,6 +65,7 @@
 
             CacheAccess<Object, Object> cache = JCSCacheManager.getCache("testUseBigDiskFile", 1, 100, "foobar");
-            assertEquals("BlockDiskCache use file size to calculate its size", 10*1024,
-                    ((BlockDiskCacheAttributes) cache.getCacheControl().getAuxCaches()[0].getAuxiliaryCacheAttributes()).getMaxKeySize());
+            assertEquals(10*1024,
+                    ((BlockDiskCacheAttributes) cache.getCacheControl().getAuxCaches()[0].getAuxiliaryCacheAttributes()).getMaxKeySize(),
+                    "BlockDiskCache use file size to calculate its size");
         }
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/coor/CachedLatLonTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/CachedLatLonTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/CachedLatLonTest.java	(revision 17275)
@@ -4,6 +4,6 @@
 import java.text.DecimalFormat;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,10 +16,10 @@
  * Unit tests for class {@link CachedLatLon}.
  */
-public class CachedLatLonTest {
+class CachedLatLonTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(CachedLatLon.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/data/coor/EastNorthTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/EastNorthTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/EastNorthTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.coor;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
@@ -11,5 +11,5 @@
  * @since 10915
  */
-public class EastNorthTest {
+class EastNorthTest {
 
     /**
@@ -17,5 +17,5 @@
      */
     @Test
-    public void testInterpolate() {
+    void testInterpolate() {
         EastNorth en1 = new EastNorth(0, 0);
         EastNorth en2 = new EastNorth(30, 60);
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testGetCenter() {
+    void testGetCenter() {
         EastNorth en1 = new EastNorth(0, 0);
         EastNorth en2 = new EastNorth(30, 60);
Index: trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.coor;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.text.DecimalFormat;
@@ -10,6 +10,6 @@
 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.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
@@ -27,5 +27,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testRoundToOsmPrecision() {
+    void testRoundToOsmPrecision() {
 
         for (double value : SAMPLE_VALUES) {
@@ -110,5 +110,5 @@
      */
     @Test
-    public void testToIntervalLat() {
+    void testToIntervalLat() {
         assertEquals(-90.0, LatLon.toIntervalLat(-90.0), 0);
         assertEquals(0.0, LatLon.toIntervalLat(0.0), 0);
@@ -123,5 +123,5 @@
      */
     @Test
-    public void testToIntervalLon() {
+    void testToIntervalLon() {
         assertEquals(-180.0, LatLon.toIntervalLon(-180.0), 0);
         assertEquals(0.0, LatLon.toIntervalLon(0.0), 0);
@@ -148,5 +148,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(LatLon.class).usingGetClass()
@@ -159,5 +159,5 @@
      */
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         assertEquals(LatLon.NORTH_POLE, new LatLon(LatLon.NORTH_POLE));
         assertEquals(LatLon.SOUTH_POLE, new LatLon(LatLon.SOUTH_POLE));
@@ -169,5 +169,5 @@
      */
     @Test
-    public void testBearing() {
+    void testBearing() {
         LatLon c = new LatLon(47.000000, 19.000000);
         LatLon e = new LatLon(47.000000, 19.000001);
@@ -183,5 +183,5 @@
      */
     @Test
-    public void testDistance() {
+    void testDistance() {
         assertEquals(0.0, LatLon.ZERO.distance(LatLon.ZERO), 0);
         assertEquals(90.0, LatLon.ZERO.distance(LatLon.NORTH_POLE), 0);
@@ -193,5 +193,5 @@
      */
     @Test
-    public void testDistanceSq() {
+    void testDistanceSq() {
         assertEquals(0.0, LatLon.ZERO.distanceSq(LatLon.ZERO), 0);
         assertEquals(90d*90d, LatLon.ZERO.distanceSq(LatLon.NORTH_POLE), 0);
@@ -203,5 +203,5 @@
      */
     @Test
-    public void testInterpolate() {
+    void testInterpolate() {
         LatLon ll1 = new LatLon(0, 0);
         LatLon ll2 = new LatLon(30, 60);
@@ -225,5 +225,5 @@
     @Test
     @Deprecated
-    public void testIsOutSideWorld() {
+    void testIsOutSideWorld() {
         assertFalse(LatLon.ZERO.isOutSideWorld());
         assertTrue(LatLon.NORTH_POLE.isOutSideWorld());
@@ -237,5 +237,5 @@
      */
     @Test
-    public void testIsValid() {
+    void testIsValid() {
         assertTrue(LatLon.ZERO.isValid());
         assertTrue(LatLon.NORTH_POLE.isValid());
@@ -252,5 +252,5 @@
      */
     @Test
-    public void testIsWithin() {
+    void testIsWithin() {
         assertTrue(LatLon.ZERO.isWithin(new Bounds(LatLon.ZERO)));
         assertFalse(LatLon.ZERO.isWithin(new Bounds(LatLon.NORTH_POLE)));
@@ -261,5 +261,5 @@
      */
     @Test
-    public void testGetCenter() {
+    void testGetCenter() {
         LatLon ll1 = new LatLon(0, 0);
         LatLon ll2 = new LatLon(30, 60);
Index: trunk/test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/PolarCoorTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.coor;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.text.DecimalFormat;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -18,10 +18,10 @@
  * Test the {@link PolarCoor} class.
  */
-public class PolarCoorTest {
+class PolarCoorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testPolarCoor() {
+    void testPolarCoor() {
         EastNorth en = new EastNorth(1000, 500);
         PolarCoor pc = new PolarCoor(en);
@@ -50,5 +50,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(PolarCoor.class).usingGetClass()
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("PolarCoor [radius=1118.033988749, angle=0.463647609, pole=EastNorth[e=0.0, n=0.0]]",
                 new PolarCoor(1118.033988749, 0.463647609).toString());
Index: trunk/test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/conversion/ICoordinateFormatTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.coor.conversion;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -15,9 +15,9 @@
  * Test for {@link ICoordinateFormat} implementations.
  */
-public class ICoordinateFormatTest {
+class ICoordinateFormatTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testFormatting() {
+    void testFormatting() {
         LatLon c = new LatLon(47.000000, 19.000000);
         assertEquals("47.0", DecimalDegreesCoordinateFormat.INSTANCE.latToString(c));
Index: trunk/test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/conversion/LatLonParserTest.java	(revision 17275)
@@ -2,22 +2,23 @@
 package org.openstreetmap.josm.data.coor.conversion;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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.junit.Rule;
-import org.junit.Test;
-import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 
 /**
  * Unit tests for class {@link LatLonParser}.
  */
-public class LatLonParserTest {
+class LatLonParserTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -27,5 +28,5 @@
      */
     @Test
-    public void testParse() {
+    void testParse() {
         assertEquals(new LatLon(49.29918, 19.24788), LatLonParser.parse("49.29918° 19.24788°"));
         assertEquals(new LatLon(49.29918, 19.24788), LatLonParser.parse("N 49.29918 E 19.24788°"));
@@ -54,7 +55,7 @@
      * Unit test of {@link LatLonParser#parse} method - invalid case 1.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testParseInvalid1() {
-        LatLonParser.parse("48°45'S 23°30'S");
+    @Test
+    void testParseInvalid1() {
+        assertThrows(IllegalArgumentException.class, () -> LatLonParser.parse("48°45'S 23°30'S"));
     }
 
@@ -62,7 +63,7 @@
      * Unit test of {@link LatLonParser#parse} method - invalid case 2.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testParseInvalid2() {
-        LatLonParser.parse("47°45'N 24°00'S");
+    @Test
+    void testParseInvalid2() {
+        assertThrows(IllegalArgumentException.class, () -> LatLonParser.parse("47°45'N 24°00'S"));
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/data/correction/TagCorrectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/correction/TagCorrectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/correction/TagCorrectionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.correction;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,10 +13,10 @@
  * Unit tests for class {@link TagCorrection}.
  */
-public class TagCorrectionTest {
+class TagCorrectionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(TagCorrection.class).usingGetClass().verify();
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 17275)
@@ -2,9 +2,10 @@
 package org.openstreetmap.josm.data.gpx;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -18,7 +19,7 @@
 import java.util.stream.Stream;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -41,10 +42,10 @@
  * Unit tests for class {@link GpxData}.
  */
-public class GpxDataTest {
+class GpxDataTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -55,5 +56,5 @@
      * Set up empty test data
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         data = new GpxData();
@@ -64,5 +65,5 @@
      */
     @Test
-    public void testMergeFrom() {
+    void testMergeFrom() {
         GpxTrack track = singleWaypointGpxTrack();
         GpxRoute route = singleWaypointRoute();
@@ -93,5 +94,5 @@
      */
     @Test
-    public void testMergeFromFiles() throws Exception {
+    void testMergeFromFiles() throws Exception {
         testMerge(false, false, "Merged-all"); // regular merging
         testMerge(true, false, "Merged-cut"); // cut overlapping tracks, but do not connect them
@@ -106,5 +107,5 @@
         own.put(GpxConstants.META_BOUNDS, null);
         expected.put(GpxConstants.META_BOUNDS, null); //they are only updated by GpxWriter
-        assertEquals(exp + " didn't match!", expected, own);
+        assertEquals(expected, own, exp + " didn't match!");
     }
 
@@ -117,5 +118,5 @@
      */
     @Test
-    public void testTracks() {
+    void testTracks() {
         assertEquals(0, data.getTracks().size());
 
@@ -138,9 +139,9 @@
      * Test method for {@link GpxData#addTrack(IGpxTrack)}.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testAddTrackFails() {
+    @Test
+    void testAddTrackFails() {
         GpxTrack track1 = emptyGpxTrack();
         data.addTrack(track1);
-        data.addTrack(track1);
+        assertThrows(IllegalArgumentException.class, () -> data.addTrack(track1));
     }
 
@@ -148,10 +149,10 @@
      * Test method for {@link GpxData#removeTrack(IGpxTrack)}.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testRemoveTrackFails() {
+    @Test
+    void testRemoveTrackFails() {
         GpxTrack track1 = emptyGpxTrack();
         data.addTrack(track1);
         data.removeTrack(track1);
-        data.removeTrack(track1);
+        assertThrows(IllegalArgumentException.class, () -> data.removeTrack(track1));
     }
 
@@ -160,5 +161,5 @@
      */
     @Test
-    public void testRoutes() {
+    void testRoutes() {
         assertEquals(0, data.getTracks().size());
 
@@ -182,9 +183,9 @@
      * Test method for {@link GpxData#addRoute(GpxRoute)}.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testAddRouteFails() {
+    @Test
+    void testAddRouteFails() {
         GpxRoute route1 = new GpxRoute();
         data.addRoute(route1);
-        data.addRoute(route1);
+        assertThrows(IllegalArgumentException.class, () -> data.addRoute(route1));
     }
 
@@ -192,10 +193,10 @@
      * Test method for {@link GpxData#removeRoute(GpxRoute)}.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testRemoveRouteFails() {
+    @Test
+    void testRemoveRouteFails() {
         GpxRoute route1 = new GpxRoute();
         data.addRoute(route1);
         data.removeRoute(route1);
-        data.removeRoute(route1);
+        assertThrows(IllegalArgumentException.class, () -> data.removeRoute(route1));
     }
 
@@ -204,5 +205,5 @@
      */
     @Test
-    public void testWaypoints() {
+    void testWaypoints() {
         assertEquals(0, data.getTracks().size());
 
@@ -225,9 +226,9 @@
      * Test method for {@link GpxData#addWaypoint(WayPoint)}.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testAddWaypointFails() {
+    @Test
+    void testAddWaypointFails() {
         WayPoint waypoint1 = new WayPoint(LatLon.ZERO);
         data.addWaypoint(waypoint1);
-        data.addWaypoint(waypoint1);
+        assertThrows(IllegalArgumentException.class, () -> data.addWaypoint(waypoint1));
     }
 
@@ -235,10 +236,10 @@
      * Test method for {@link GpxData#removeWaypoint(WayPoint)}.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testRemoveWaypointFails() {
+    @Test
+    void testRemoveWaypointFails() {
         WayPoint waypoint1 = new WayPoint(LatLon.ZERO);
         data.addWaypoint(waypoint1);
         data.removeWaypoint(waypoint1);
-        data.removeWaypoint(waypoint1);
+        assertThrows(IllegalArgumentException.class, () -> data.removeWaypoint(waypoint1));
     }
 
@@ -247,5 +248,5 @@
      */
     @Test
-    public void testHasTrackPoints() {
+    void testHasTrackPoints() {
         assertFalse(data.hasTrackPoints());
         GpxTrack track1 = emptyGpxTrack();
@@ -261,5 +262,5 @@
      */
     @Test
-    public void testGetTrackPoints() {
+    void testGetTrackPoints() {
         assertEquals(0, data.getTrackPoints().count());
         GpxTrack track1 = singleWaypointGpxTrack();
@@ -275,5 +276,5 @@
      */
     @Test
-    public void testHasRoutePoints() {
+    void testHasRoutePoints() {
 
     }
@@ -283,5 +284,5 @@
      */
     @Test
-    public void testIsEmpty() {
+    void testIsEmpty() {
         GpxTrack track1 = singleWaypointGpxTrack();
         WayPoint waypoint = new WayPoint(LatLon.ZERO);
@@ -310,5 +311,5 @@
      */
     @Test
-    public void testLength() {
+    void testLength() {
         GpxTrack track1 = waypointGpxTrack(
                 new WayPoint(new LatLon(0, 0)),
@@ -328,5 +329,5 @@
      */
     @Test
-    public void testGetMinMaxTimeForAllTracks() {
+    void testGetMinMaxTimeForAllTracks() {
         assertEquals(0, data.getMinMaxTimeForAllTracks().length);
 
@@ -352,5 +353,5 @@
      */
     @Test
-    public void testNearestPointOnTrack() {
+    void testNearestPointOnTrack() {
         List<WayPoint> points = Stream
                 .of(new EastNorth(10, 10), new EastNorth(10, 0), new EastNorth(-1, 0))
@@ -378,5 +379,5 @@
      */
     @Test
-    public void testGetDataSources() {
+    void testGetDataSources() {
         DataSource ds = new DataSource(new Bounds(0, 0, 1, 1), "test");
         data.dataSources.add(ds);
@@ -388,5 +389,5 @@
      */
     @Test
-    public void testGetDataSourceArea() {
+    void testGetDataSourceArea() {
         DataSource ds = new DataSource(new Bounds(0, 0, 1, 1), "test");
         data.dataSources.add(ds);
@@ -400,5 +401,5 @@
      */
     @Test
-    public void testGetDataSourceBounds() {
+    void testGetDataSourceBounds() {
         Bounds bounds = new Bounds(0, 0, 1, 1);
         DataSource ds = new DataSource(bounds, "test");
@@ -413,5 +414,5 @@
      */
     @Test
-    public void testChangeListener() {
+    void testChangeListener() {
         TestChangeListener cl1 = new TestChangeListener();
         TestChangeListener cl2 = new TestChangeListener();
@@ -474,5 +475,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         GpxExtensionCollection col = new GpxExtensionCollection();
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxExtensionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxExtensionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxExtensionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.gpx;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerActionTest;
@@ -17,10 +17,10 @@
  * Unit tests for class {@link GpxExtension}
  */
-public class GpxExtensionTest {
+class GpxExtensionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         GpxExtensionCollection col = new GpxExtensionCollection();
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxImageCorrelationTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxImageCorrelationTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxImageCorrelationTest.java	(revision 17275)
@@ -2,15 +2,15 @@
 package org.openstreetmap.josm.data.gpx;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
 import java.util.List;
 
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+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.coor.CachedLatLon;
@@ -28,10 +28,10 @@
  * Unit tests of {@link GpxImageCorrelation} class.
  */
-public class GpxImageCorrelationTest {
+class GpxImageCorrelationTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -40,5 +40,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         DateUtilsTest.setTimeZone(DateUtils.UTC);
@@ -50,5 +50,5 @@
      */
     @Test
-    public void testMatchGpxTrack() throws Exception {
+    void testMatchGpxTrack() throws Exception {
         IPreferences s = Config.getPref();
         final GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + "tracks/tracks.gpx");
@@ -274,5 +274,5 @@
      */
     @Test
-    public void testGetElevation() {
+    void testGetElevation() {
         assertNull(GpxImageCorrelation.getElevation(null));
         WayPoint wp = new WayPoint(LatLon.ZERO);
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxImageEntryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxImageEntryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxImageEntryTest.java	(revision 17275)
@@ -4,6 +4,6 @@
 import java.io.File;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,10 +16,10 @@
  * Unit tests of {@link GpxImageEntry} class.
  */
-public class GpxImageEntryTest {
+class GpxImageEntryTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(GpxImageEntry.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxOffsetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxOffsetTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxOffsetTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.gpx;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.text.ParseException;
 
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.date.DateUtils;
@@ -18,10 +18,10 @@
  * Unit tests of {@link GpxTimeOffset} class.
  */
-public class GpxOffsetTest {
+class GpxOffsetTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         DateUtilsTest.setTimeZone(DateUtils.UTC);
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testFormatOffset() {
+    void testFormatOffset() {
         assertEquals("0", GpxTimeOffset.seconds(0).formatOffset());
         assertEquals("123", GpxTimeOffset.seconds(123).formatOffset());
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testParseOffest() throws ParseException {
+    void testParseOffest() throws ParseException {
         assertEquals(0, GpxTimeOffset.parseOffset("0").getSeconds());
         assertEquals(4242L, GpxTimeOffset.parseOffset("4242").getSeconds());
@@ -69,5 +69,5 @@
      */
     @Test
-    public void testSplitOutTimezone() {
+    void testSplitOutTimezone() {
         assertEquals("+1:00", GpxTimeOffset.seconds(3602).splitOutTimezone().a.formatTimezone());
         assertEquals("2", GpxTimeOffset.seconds(3602).splitOutTimezone().b.formatOffset());
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxRouteTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxRouteTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxRouteTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.gpx;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -15,10 +15,10 @@
  * Unit tests for class {@link GpxRoute}.
  */
-public class GpxRouteTest {
+class GpxRouteTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         GpxExtensionCollection col = new GpxExtensionCollection();
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTimezoneTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTimezoneTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTimezoneTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.gpx;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.text.ParseException;
 
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.date.DateUtils;
@@ -18,10 +18,10 @@
  * Unit tests of {@link GpxTimezone} class.
  */
-public class GpxTimezoneTest {
+class GpxTimezoneTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         DateUtilsTest.setTimeZone(DateUtils.UTC);
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testFormatTimezone() {
+    void testFormatTimezone() {
         assertEquals("+1:00", new GpxTimezone(1).formatTimezone());
         assertEquals("+6:30", new GpxTimezone(6.5).formatTimezone());
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testParseTimezone() throws ParseException {
+    void testParseTimezone() throws ParseException {
         assertEquals(1, GpxTimezone.parseTimezone("+01:00").getHours(), 1e-3);
         assertEquals(1, GpxTimezone.parseTimezone("+1:00").getHours(), 1e-3);
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTrackSegmentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTrackSegmentTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTrackSegmentTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.gpx;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -15,10 +15,10 @@
  * Unit tests for class {@link GpxTrackSegment}.
  */
-public class GpxTrackSegmentTest {
+class GpxTrackSegmentTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         GpxExtensionCollection col = new GpxExtensionCollection();
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTrackTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTrackTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxTrackTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.gpx;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.awt.Color;
@@ -9,6 +9,6 @@
 import java.util.HashMap;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -22,10 +22,10 @@
  * Unit tests for class {@link GpxTrack}.
  */
-public class GpxTrackTest {
+class GpxTrackTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testColors() {
+    void testColors() {
         GpxTrack trk = new GpxTrack(new ArrayList<IGpxTrackSegment>(), new HashMap<>());
         GpxExtensionCollection ext = trk.getExtensions();
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         GpxExtensionCollection col = new GpxExtensionCollection();
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/WayPointTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/WayPointTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/WayPointTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.gpx;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests for class {@link WayPoint}.
  */
-public class WayPointTest {
+class WayPointTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         GpxExtensionCollection col = new GpxExtensionCollection();
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/WithAttributesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/WithAttributesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/WithAttributesTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.gpx;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests for class {@link WithAttributes}.
  */
-public class WithAttributesTest {
+class WithAttributesTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         GpxExtensionCollection col = new GpxExtensionCollection();
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelperTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelperTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelperTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.imagery;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -14,10 +14,10 @@
  * Unit tests for class {@link GetCapabilitiesParseHelper}.
  */
-public class GetCapabilitiesParseHelperTest {
+class GetCapabilitiesParseHelperTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(GetCapabilitiesParseHelper.class);
     }
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testCrsToCode() {
+    void testCrsToCode() {
         assertEquals("EPSG:3127", GetCapabilitiesParseHelper.crsToCode("urn:ogc:def:crs:epsg:3127"));
         assertEquals("EPSG:3127", GetCapabilitiesParseHelper.crsToCode("urn:ogc:def:crs:epsg::3127"));
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/ImageryInfoTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/ImageryInfoTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/ImageryInfoTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.data.imagery;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
@@ -10,6 +10,6 @@
 import java.util.Set;
 
-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.data.StructUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -23,10 +23,10 @@
  *
  */
-public class ImageryInfoTest {
+class ImageryInfoTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testGetExtendedUrl() {
+    void testGetExtendedUrl() {
         ImageryInfo testImageryTMS = new ImageryInfo("test imagery", "http://localhost", "tms", null, null);
         testImageryTMS.setDefaultMinZoom(16);
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testConstruct13264() {
+    void testConstruct13264() {
         final ImageryInfo info = new ImageryInfo("test imagery", "tms[16-23]:http://localhost");
         assertEquals(ImageryInfo.ImageryType.TMS, info.getImageryType());
@@ -56,8 +56,8 @@
 
     /**
-     * Tests the {@linkplain StructUtils#serializeStruct(Object, Class) serialization} of {@link ImageryInfo.ImageryPreferenceEntry}
+     * Tests the {@linkplain StructUtils#serializeStruct serialization} of {@link ImageryInfo.ImageryPreferenceEntry}
      */
     @Test
-    public void testSerializeStruct() {
+    void testSerializeStruct() {
         final ImageryInfo.ImageryPreferenceEntry info = new ImageryInfo.ImageryPreferenceEntry();
         info.noTileHeaders = new MultiMap<>();
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testDeserializeStruct() {
+    void testDeserializeStruct() {
         final ImageryInfo.ImageryPreferenceEntry info = StructUtils.deserializeStruct(
                 Collections.singletonMap("noTileHeaders", "{\"ETag\":[\"foo\",\"bar\"]}"), ImageryInfo.ImageryPreferenceEntry.class);
@@ -87,5 +87,5 @@
      */
     @Test
-    public void testDeserializeStructTicket12474() {
+    void testDeserializeStructTicket12474() {
         final ImageryInfo.ImageryPreferenceEntry info = StructUtils.deserializeStruct(
                 Collections.singletonMap("noTileHeaders", "{\"ETag\":\"foo-and-bar\"}"), ImageryInfo.ImageryPreferenceEntry.class);
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/ShapeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/ShapeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/ShapeTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.data.imagery;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests for class {@link Shape}.
  */
-public class ShapeTest {
+class ShapeTest {
 
     /**
@@ -17,5 +17,5 @@
      */
     @Test
-    public void test() {
+    void test() {
         Shape shape = new Shape();
         shape.addPoint("47.1", "11.1");
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.data.imagery;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Rule;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.gui.jmapviewer.TileXY;
 import org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate;
@@ -24,5 +24,5 @@
  * Unit tests for class {@link TemplatedWMSTileSource}.
  */
-public class TemplatedWMSTileSourceTest {
+class TemplatedWMSTileSourceTest {
 
     private final ImageryInfo testImageryWMS = new ImageryInfo("test imagery", "http://localhost", "wms", null, null);
@@ -32,5 +32,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testEPSG3857() {
+    void testEPSG3857() {
         Projection projection = Projections.getProjectionByCode("EPSG:3857");
         ProjectionRegistry.setProjection(projection);
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testEPSG4326() {
+    void testEPSG4326() {
         Projection projection = Projections.getProjectionByCode("EPSG:4326");
         ProjectionRegistry.setProjection(projection);
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testEPSG4326widebounds() {
+    void testEPSG4326widebounds() {
         Projection projection = new CustomProjection("+proj=lonlat +datum=WGS84 +axis=neu +bounds=-180,53,180,54");
         ProjectionRegistry.setProjection(projection);
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testEPSG4326narrowbounds() {
+    void testEPSG4326narrowbounds() {
         Projection projection = new CustomProjection("+proj=lonlat +datum=WGS84 +axis=neu +bounds=18,-90,20,90");
         ProjectionRegistry.setProjection(projection);
@@ -107,5 +107,5 @@
      */
     @Test
-    public void testEPSG2180() {
+    void testEPSG2180() {
         Projection projection = Projections.getProjectionByCode("EPSG:2180");
         ProjectionRegistry.setProjection(projection);
@@ -124,5 +124,5 @@
      */
     @Test
-    public void testEPSG3006withbounds() {
+    void testEPSG3006withbounds() {
         Projection projection =
                 new CustomProjection("+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "
@@ -140,5 +140,5 @@
      */
     @Test
-    public void testEPSG3006withoutbounds() {
+    void testEPSG3006withoutbounds() {
         Projection projection =
                 new CustomProjection("+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "
@@ -156,5 +156,5 @@
      */
     @Test
-    public void testGetTileUrl() {
+    void testGetTileUrl() {
         // "https://maps.six.nsw.gov.au/arcgis/services/public/NSW_Imagery_Dates/MapServer/WMSServer?
         // SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS={proj}&BBOX={bbox}&WIDTH={width}&HEIGHT={height}
@@ -206,5 +206,5 @@
         ICoordinate expected = verifier.tileXYToLatLon(x, y, z - 1);
         assertEquals(expected.getLat(), result.lat(), 1e-4);
-        assertEquals(LatLon.normalizeLon(expected.getLon() - result.lon()), 0.0, 1e-4);
+        assertEquals(0.0, LatLon.normalizeLon(expected.getLon() - result.lon()), 1e-4);
         LatLon tileCenter = new Bounds(result, getTileLatLon(source, x+1, y+1, z)).getCenter();
         TileXY backwardsResult = source.latLonToTileXY(CoordinateConversion.llToCoor(tileCenter), z);
@@ -224,16 +224,13 @@
     private void verifyLocation(TemplatedWMSTileSource source, LatLon location, int z) {
         Projection projection = ProjectionRegistry.getProjection();
-        assertTrue(
-                "Point outside world bounds",
-                projection.getWorldBoundsLatLon().contains(location)
-                );
+        assertTrue(projection.getWorldBoundsLatLon().contains(location), "Point outside world bounds");
 
         TileXY tileIndex = source.latLonToTileXY(CoordinateConversion.llToCoor(location), z);
 
-        assertTrue("X index: " + tileIndex.getXIndex() + " greater than tileXmax: " + source.getTileXMax(z) + " at zoom: " + z,
-                tileIndex.getXIndex() <= source.getTileXMax(z));
-
-        assertTrue("Y index: " + tileIndex.getYIndex() + " greater than tileYmax: " + source.getTileYMax(z) + " at zoom: " + z,
-                tileIndex.getYIndex() <= source.getTileYMax(z));
+        assertTrue(tileIndex.getXIndex() <= source.getTileXMax(z),
+                "X index: " + tileIndex.getXIndex() + " greater than tileXmax: " + source.getTileXMax(z) + " at zoom: " + z);
+
+        assertTrue(tileIndex.getYIndex() <= source.getTileYMax(z),
+                "Y index: " + tileIndex.getYIndex() + " greater than tileYmax: " + source.getTileYMax(z) + " at zoom: " + z);
 
         ICoordinate x1 = source.tileXYToLatLon(tileIndex.getXIndex(), tileIndex.getYIndex(), z);
@@ -245,6 +242,6 @@
         bounds.extend(x2.getLat(), x2.getLon());
         // test that location is within tile bounds
-        assertTrue(location + " not within " + bounds + " for tile " + z + "/" + tileIndex.getXIndex() + "/" + tileIndex.getYIndex(),
-                bounds.contains(location));
+        assertTrue(bounds.contains(location),
+                location + " not within " + bounds + " for tile " + z + "/" + tileIndex.getXIndex() + "/" + tileIndex.getYIndex());
         verifyTileSquareness(source, tileIndex.getXIndex(), tileIndex.getYIndex(), z);
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/notes/NoteCommentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/notes/NoteCommentTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/notes/NoteCommentTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.data.notes;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Date;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -17,10 +17,10 @@
  * Unit tests for class {@link NoteComment}.
  */
-public class NoteCommentTest {
+class NoteCommentTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testNoteComment() {
+    void testNoteComment() {
         NoteComment comment = new NoteComment(new Date(), null, "foo", null, true);
         assertEquals("foo", comment.toString());
Index: trunk/test/unit/org/openstreetmap/josm/data/notes/NoteTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/notes/NoteTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/notes/NoteTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.notes;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
 
 import java.util.Date;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -20,10 +20,10 @@
  * Unit tests for class {@link NoteComment}.
  */
-public class NoteTest {
+class NoteTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         Note note = new Note(LatLon.ZERO);
         assertEquals("Note 0: null", note.toString());
@@ -44,5 +44,5 @@
      */
     @Test
-    public void testUpdateWith() {
+    void testUpdateWith() {
         Note n1 = new Note(LatLon.ZERO);
         n1.setId(1);
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(Note.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.oauth;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.spi.preferences.Config;
@@ -19,10 +19,10 @@
  * Unit tests for class {@link OAuthParameters}.
  */
-public class OAuthParametersTest {
+class OAuthParametersTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
     @Test
     @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
-    public void testCreateDefault() {
+    void testCreateDefault() {
         OAuthParameters def = OAuthParameters.createDefault();
         assertNotNull(def);
@@ -50,5 +50,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(OAuthParameters.class).usingGetClass().verify();
Index: trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.oauth;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 
@@ -14,5 +14,5 @@
  * Unit tests for class {@link OAuthToken}.
  */
-public class OAuthTokenTest {
+class OAuthTokenTest {
 
     /**
@@ -20,5 +20,5 @@
      */
     @Test
-    public void testCreateToken() {
+    void testCreateToken() {
         OAuthConsumer defCon = OAuthParameters.createDefault().buildConsumer();
         assertNotNull(defCon);
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(OAuthToken.class).usingGetClass().verify();
Index: trunk/test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.data.oauth;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests for class {@link OsmPrivileges}.
  */
-public class OsmPrivilegesTest {
+class OsmPrivilegesTest {
 
     /**
@@ -16,5 +16,5 @@
      */
     @Test
-    public void testGettersSetters() {
+    void testGettersSetters() {
         OsmPrivileges p = new OsmPrivileges();
         assertFalse(p.isAllowModifyNotes());
Index: trunk/test/unit/org/openstreetmap/josm/data/oauth/SignpostAdaptersTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/oauth/SignpostAdaptersTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/oauth/SignpostAdaptersTest.java	(revision 17275)
@@ -2,7 +2,8 @@
 package org.openstreetmap.josm.data.oauth;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+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 java.io.IOException;
@@ -10,6 +11,6 @@
 import java.net.URL;
 
-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.data.oauth.SignpostAdapters.HttpRequest;
 import org.openstreetmap.josm.data.oauth.SignpostAdapters.HttpResponse;
@@ -24,10 +25,10 @@
  * Unit tests for class {@link SignpostAdapters}.
  */
-public class SignpostAdaptersTest {
+class SignpostAdaptersTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().https();
@@ -42,5 +43,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(SignpostAdapters.class);
     }
@@ -51,5 +52,5 @@
      */
     @Test
-    public void testOAuthConsumerWrap() throws MalformedURLException {
+    void testOAuthConsumerWrap() throws MalformedURLException {
         assertNotNull(new OAuthConsumer("", "").wrap(newClient()));
     }
@@ -60,5 +61,5 @@
      */
     @Test
-    public void testHttpRequestGetMessagePayload() throws IOException {
+    void testHttpRequestGetMessagePayload() throws IOException {
         assertNull(new HttpRequest(newClient()).getMessagePayload());
     }
@@ -66,27 +67,24 @@
     /**
      * Unit test of method {@link SignpostAdapters.HttpRequest#setRequestUrl}.
-     * @throws IOException never
      */
-    @Test(expected = IllegalStateException.class)
-    public void testHttpRequestSetRequestUrl() throws IOException {
-        new HttpRequest(newClient()).setRequestUrl(null);
+    @Test
+    void testHttpRequestSetRequestUrl() {
+        assertThrows(IllegalStateException.class, () -> new HttpRequest(newClient()).setRequestUrl(null));
     }
 
     /**
      * Unit test of method {@link SignpostAdapters.HttpRequest#getAllHeaders}.
-     * @throws IOException never
      */
-    @Test(expected = IllegalStateException.class)
-    public void testHttpRequestGetAllHeaders() throws IOException {
-        new HttpRequest(newClient()).getAllHeaders();
+    @Test
+    void testHttpRequestGetAllHeaders() {
+        assertThrows(IllegalStateException.class, () -> new HttpRequest(newClient()).getAllHeaders());
     }
 
     /**
      * Unit test of method {@link SignpostAdapters.HttpRequest#unwrap}.
-     * @throws IOException never
      */
-    @Test(expected = IllegalStateException.class)
-    public void testHttpRequestUnwrap() throws IOException {
-        new HttpRequest(newClient()).unwrap();
+    @Test
+    void testHttpRequestUnwrap() {
+        assertThrows(IllegalStateException.class, () -> new HttpRequest(newClient()).unwrap());
     }
 
@@ -96,5 +94,5 @@
      */
     @Test
-    public void testHttpResponseGetReasonPhrase() throws Exception {
+    void testHttpResponseGetReasonPhrase() throws Exception {
         assertEquals("OK", new HttpResponse(new HttpRequest(newClient()).request.connect()).getReasonPhrase());
     }
@@ -102,9 +100,8 @@
     /**
      * Unit test of method {@link SignpostAdapters.HttpResponse#unwrap}.
-     * @throws IOException never
      */
-    @Test(expected = IllegalStateException.class)
-    public void testHttpResponseUnwrap() throws IOException {
-        new HttpResponse(new HttpRequest(newClient()).request.connect()).unwrap();
+    @Test
+    void testHttpResponseUnwrap() {
+        assertThrows(IllegalStateException.class, () -> new HttpResponse(new HttpRequest(newClient()).request.connect()).unwrap());
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/AbstractPrimitiveTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/AbstractPrimitiveTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/AbstractPrimitiveTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -16,10 +16,10 @@
  * Unit tests of the {@code AbstractPrimitive} class.
  */
-public class AbstractPrimitiveTest {
+class AbstractPrimitiveTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testIsUndeleted() {
+    void testIsUndeleted() {
         AbstractPrimitive p = new Node(1);
         p.setVisible(false);
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testHasTagDifferent() {
+    void testHasTagDifferent() {
         AbstractPrimitive p = new Node();
 
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/BBoxTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/BBoxTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/BBoxTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -19,10 +19,10 @@
  * Unit tests for class {@link BBox}.
  */
-public class BBoxTest {
+class BBoxTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(BBox.class).usingGetClass()
@@ -43,5 +43,5 @@
      */
     @Test
-    public void testBboxesAreFunctionallyEqual() {
+    void testBboxesAreFunctionallyEqual() {
         BBox bbox1 = new BBox(0, 1, 1, 0);
         BBox bbox2 = new BBox(0.1, 0.9, 0.9, 0.1);
@@ -63,5 +63,5 @@
      */
     @Test
-    public void testLatLonConstructor() {
+    void testLatLonConstructor() {
         LatLon latLon1 = new LatLon(10, 20);
         LatLon latLon2 = new LatLon(20, 10);
@@ -95,5 +95,5 @@
      */
     @Test
-    public void testDoubleConstructor() {
+    void testDoubleConstructor() {
         assertTrue(new BBox(1, 2, 3, 4).isValid());
         assertFalse(new BBox(Double.NaN, 2, 3, 4).isValid());
@@ -107,5 +107,5 @@
      */
     @Test
-    public void testNodeConstructor() {
+    void testNodeConstructor() {
         assertTrue(new BBox(new Node(LatLon.NORTH_POLE)).isValid());
         assertFalse(new BBox(new Node()).isValid());
@@ -116,5 +116,5 @@
      */
     @Test
-    public void testAddLatLon() {
+    void testAddLatLon() {
         BBox b = new BBox();
         b.add((LatLon) null);
@@ -130,5 +130,5 @@
      */
     @Test
-    public void testAddLatLonBuffer() {
+    void testAddLatLonBuffer() {
         BBox b = new BBox();
         b.addLatLon(LatLon.NORTH_POLE, 0.5);
@@ -142,5 +142,5 @@
      */
     @Test
-    public void testAddDouble() {
+    void testAddDouble() {
         BBox b = new BBox();
         b.add(1, Double.NaN);
@@ -157,5 +157,5 @@
      */
     @Test
-    public void testAddPrimitive() {
+    void testAddPrimitive() {
         BBox b = new BBox();
         b.addPrimitive(new Node(LatLon.NORTH_POLE), 0.5);
@@ -169,5 +169,5 @@
      */
     @Test
-    public void testHeightWidthArea() {
+    void testHeightWidthArea() {
         BBox b1 = new BBox(1, 2, 3, 5);
         assertEquals(2, b1.width(), 1e-7);
@@ -184,5 +184,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("[ x: Infinity -> -Infinity, y: Infinity -> -Infinity ]", new BBox().toString());
         assertEquals("[ x: 1.0 -> 3.0, y: 2.0 -> 4.0 ]", new BBox(1, 2, 3, 4).toString());
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -13,8 +13,8 @@
 import java.util.concurrent.TimeUnit;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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.UserIdentityManager;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -26,10 +26,10 @@
  * Unit test of {@link ChangesetCache}
  */
-public class ChangesetCacheTest {
+class ChangesetCacheTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -40,6 +40,6 @@
      * Clears cache before/after each unit test.
      */
-    @After
-    @Before
+    @AfterEach
+    @BeforeEach
     public void clearCache() {
         cache.listeners.clear();
@@ -73,10 +73,10 @@
      */
     @Test
-    public void testConstructor() {
+    void testConstructor() {
         assertNotNull(ChangesetCache.getInstance());
     }
 
     @Test
-    public void testAddAndRemoveListeners() {
+    void testAddAndRemoveListeners() {
         // should work
         cache.addChangesetCacheListener(null);
@@ -97,5 +97,5 @@
 
     @Test
-    public void testUpdateGetRemoveCycle() {
+    void testUpdateGetRemoveCycle() {
         cache.update(new Changeset(1));
         assertEquals(1, cache.size());
@@ -107,5 +107,5 @@
 
     @Test
-    public void testUpdateTwice() {
+    void testUpdateTwice() {
         Changeset cs = new Changeset(1);
         cs.setIncomplete(false);
@@ -130,5 +130,5 @@
 
     @Test
-    public void testContains() {
+    void testContains() {
         Changeset cs = new Changeset(1);
         cache.update(cs);
@@ -144,8 +144,8 @@
 
     @Test
-    public void testFireingEventsAddAChangeset() {
+    void testFireingEventsAddAChangeset() {
         TestListener listener = new TestListener() {
             @Override
-            public void test() {
+            void test() {
                 await();
                 assertNotNull(event);
@@ -163,5 +163,5 @@
 
     @Test
-    public void testFireingEventsUpdateChangeset() {
+    void testFireingEventsUpdateChangeset() {
         // Waiter listener to ensure the second listener does not receive the first event
         TestListener waiter = new TestListener() {
@@ -195,5 +195,5 @@
 
     @Test
-    public void testFireingEventsRemoveChangeset() {
+    void testFireingEventsRemoveChangeset() {
         // Waiter listener to ensure the second listener does not receive the first event
         TestListener waiter = new TestListener() {
@@ -229,14 +229,8 @@
      */
     @Test
-    public void testGetOpenChangesets() {
+    void testGetOpenChangesets() {
         // empty cache => empty list
-        assertTrue(
-                "Empty cache should produce an empty list.",
-                cache.getOpenChangesets().isEmpty()
-        );
-        assertTrue(
-                "Empty cache should produce an empty list.",
-                cache.getChangesets().isEmpty()
-        );
+        assertTrue(cache.getOpenChangesets().isEmpty(), "Empty cache should produce an empty list.");
+        assertTrue(cache.getChangesets().isEmpty(), "Empty cache should produce an empty list.");
 
         // cache with only closed changesets => empty list
@@ -244,8 +238,6 @@
         closedCs.setOpen(false);
         cache.update(closedCs);
-        assertTrue(
-                "Cache with only closed changesets should produce an empty list.",
-                cache.getOpenChangesets().isEmpty()
-        );
+        assertTrue(cache.getOpenChangesets().isEmpty(),
+                "Cache with only closed changesets should produce an empty list.");
         assertEquals(1, cache.getChangesets().size());
 
@@ -265,10 +257,8 @@
      */
     @Test
-    public void testGetOpenChangesetsForCurrentUser() {
+    void testGetOpenChangesetsForCurrentUser() {
         // empty cache => empty list
-        assertTrue(
-                "Empty cache should produce an empty list.",
-                cache.getOpenChangesetsForCurrentUser().isEmpty()
-        );
+        assertTrue(cache.getOpenChangesetsForCurrentUser().isEmpty(),
+                "Empty cache should produce an empty list.");
 
         Changeset openCs1 = new Changeset(1);
@@ -299,5 +289,5 @@
      */
     @Test
-    public void testRemove() {
+    void testRemove() {
         Changeset cs1 = new Changeset(1);
         cache.update(cs1);
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.Date;
 import java.util.Iterator;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -25,10 +25,10 @@
  * Unit tests for class {@link ChangesetDataSet}.
  */
-public class ChangesetDataSetTest {
+class ChangesetDataSetTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -38,5 +38,5 @@
      */
     @Test
-    public void testIterator() {
+    void testIterator() {
         final ChangesetDataSet cds = new ChangesetDataSet();
         HistoryNode prim1 = new HistoryNode(1, 1, true, User.getAnonymous(), 1, new Date(), LatLon.ZERO);
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testGetEntry() {
+    void testGetEntry() {
         final ChangesetDataSet cds = new ChangesetDataSet();
         HistoryNode prim1 = new HistoryNode(1, 1, true, User.getAnonymous(), 1, new Date(), LatLon.ZERO);
@@ -80,5 +80,5 @@
      */
     @Test
-    public void testEnumChangesetModificationType() {
+    void testEnumChangesetModificationType() {
         TestUtils.superficialEnumCodeCoverage(ChangesetModificationType.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDiscussionCommentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDiscussionCommentTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDiscussionCommentTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Date;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -15,10 +15,10 @@
  * Unit tests for class {@link ChangesetDiscussionComment}.
  */
-public class ChangesetDiscussionCommentTest {
+class ChangesetDiscussionCommentTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testChangesetDiscussionComment() {
+    void testChangesetDiscussionComment() {
         Date d = new Date(1000);
         User foo = User.createOsmUser(1, "foo");
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testText() {
+    void testText() {
         ChangesetDiscussionComment cdc = new ChangesetDiscussionComment(new Date(), null);
         cdc.setText("foo");
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.openstreetmap.josm.data.osm.Changeset.MAX_CHANGESET_TAG_LENGTH;
 
@@ -17,6 +17,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -29,10 +29,10 @@
  * Unit tests for class {@link Changeset}.
  */
-public class ChangesetTest {
+class ChangesetTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -43,5 +43,5 @@
     @Test
     @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS")
-    public void testSetKeys() {
+    void testSetKeys() {
         final Changeset cs = new Changeset();
         // Cannot add null map => IllegalArgumentException
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testCompareTo() {
+    void testCompareTo() {
         Changeset cs1 = new Changeset(1);
         Changeset cs2 = new Changeset(2);
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testGetBounds() {
+    void testGetBounds() {
         Changeset cs = new Changeset();
         assertNull(cs.getBounds());
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testGetSetHasContent() {
+    void testGetSetHasContent() {
         Changeset cs = new Changeset();
         assertNull(cs.getContent());
@@ -126,5 +126,5 @@
      */
     @Test
-    public void testGetDisplayName() {
+    void testGetDisplayName() {
         assertEquals("Changeset 0", new Changeset().getDisplayName(DefaultNameFormatter.getInstance()));
     }
@@ -134,5 +134,5 @@
      */
     @Test
-    public void testGetName() {
+    void testGetName() {
         assertEquals("changeset 0", new Changeset().getName());
     }
@@ -148,5 +148,5 @@
      */
     @Test
-    public void testHasEqualSemanticAttributes() {
+    void testHasEqualSemanticAttributes() {
         Date today = new Date();
         Changeset cs1 = new Changeset();
@@ -244,5 +244,5 @@
      */
     @Test
-    public void testKeySet() {
+    void testKeySet() {
         Changeset cs = new Changeset();
         assertTrue(cs.keySet().isEmpty());
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/DataIntegrityProblemExceptionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/DataIntegrityProblemExceptionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/DataIntegrityProblemExceptionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -14,10 +14,10 @@
  * Unit tests for class {@link DataIntegrityProblemException}.
  */
-public class DataIntegrityProblemExceptionTest {
+class DataIntegrityProblemExceptionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testDataIntegrityException() {
+    void testDataIntegrityException() {
         DataIntegrityProblemException e1 = new DataIntegrityProblemException("foo");
         assertEquals("foo", e1.getMessage());
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.StringWriter;
@@ -15,8 +15,8 @@
 import java.util.Date;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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.coor.LatLon;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
@@ -29,10 +29,10 @@
  * Unit tests for class {@link DataSetMerger}.
  */
-public class DataSetMergerTest {
+class DataSetMergerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -44,5 +44,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         my = new DataSet();
@@ -67,5 +67,5 @@
     }
 
-    @After
+    @AfterEach
     public void checkDatasets() {
         runConsistencyTests(my);
@@ -80,5 +80,5 @@
      */
     @Test
-    public void testNodeSimpleIdenticalNoConflict() {
+    void testNodeSimpleIdenticalNoConflict() {
         Node n = new Node(LatLon.ZERO);
         n.setOsmId(1, 1);
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testNodeSimpleLocallyUnmodifiedNoConflict() {
+    void testNodeSimpleLocallyUnmodifiedNoConflict() {
         Node n = new Node(LatLon.ZERO);
         n.setOsmId(1, 1);
@@ -154,5 +154,5 @@
      */
     @Test
-    public void testNodeSimpleTagConflict() {
+    void testNodeSimpleTagConflict() {
         Node n = new Node(LatLon.ZERO);
         n.setOsmId(1, 1);
@@ -188,5 +188,5 @@
      */
     @Test
-    public void testNodeSimpleDeleteConflict() {
+    void testNodeSimpleDeleteConflict() {
         Node n = new Node(1, 1);
         n.setCoor(LatLon.ZERO);
@@ -218,5 +218,5 @@
      */
     @Test
-    public void testNodeSimpleDeleteConflict2() {
+    void testNodeSimpleDeleteConflict2() {
         Node n = new Node(LatLon.ZERO);
         n.setOsmId(1, 1);
@@ -246,5 +246,5 @@
      */
     @Test
-    public void testNodeSimpleDeleteConflict3() {
+    void testNodeSimpleDeleteConflict3() {
         Node n = new Node(new LatLon(1, 1));
         n.setDeleted(true);
@@ -269,5 +269,5 @@
      */
     @Test
-    public void testNodeSimpleDeleteConflict4() {
+    void testNodeSimpleDeleteConflict4() {
         Node n = new Node(new LatLon(1, 1));
         n.setDeleted(true);
@@ -294,5 +294,5 @@
      */
     @Test
-    public void testNodeSimpleNoIdSemanticallyEqual() {
+    void testNodeSimpleNoIdSemanticallyEqual() {
 
         User myUser = User.createOsmUser(1111, "my");
@@ -334,5 +334,5 @@
      */
     @Test
-    public void testNodeSimpleIncompleteNode() {
+    void testNodeSimpleIncompleteNode() {
 
         Node n = new Node(1);
@@ -364,5 +364,5 @@
      */
     @Test
-    public void testWaySimpleIdenticalNodesDifferentTags() {
+    void testWaySimpleIdenticalNodesDifferentTags() {
 
         // -- the target dataset
@@ -436,5 +436,5 @@
      */
     @Test
-    public void testWaySimpleAdditionalNodesAndChangedNodes() {
+    void testWaySimpleAdditionalNodesAndChangedNodes() {
 
         // -- my data set
@@ -505,5 +505,5 @@
      */
     @Test
-    public void testWaySimpleDifferentNodesAndMyIsModified() {
+    void testWaySimpleDifferentNodesAndMyIsModified() {
 
         // -- the target dataset
@@ -569,5 +569,5 @@
      */
     @Test
-    public void testWaySimpleTheirVersionNotVisibleMyIsModified() {
+    void testWaySimpleTheirVersionNotVisibleMyIsModified() {
 
         Node mn1 = new Node(LatLon.ZERO);
@@ -611,5 +611,5 @@
      */
     @Test
-    public void testWaySimpleTwoWaysWithNoIdNodesWithId() {
+    void testWaySimpleTwoWaysWithNoIdNodesWithId() {
 
         // -- my data set
@@ -668,5 +668,5 @@
      */
     @Test
-    public void testWaySimpleTwoWaysWithNoIdNodesWithoutId() {
+    void testWaySimpleTwoWaysWithNoIdNodesWithoutId() {
 
         // -- my data set
@@ -723,5 +723,5 @@
      */
     @Test
-    public void testWayComplexMergingADeletedNode() {
+    void testWayComplexMergingADeletedNode() {
 
         // -- my dataset
@@ -777,5 +777,5 @@
      */
     @Test
-    public void testRelationComplexMergingADeletedNode() {
+    void testRelationComplexMergingADeletedNode() {
 
         Node mn1 = new Node(LatLon.ZERO);
@@ -826,5 +826,5 @@
      */
     @Test
-    public void testNewIncompleteWay() {
+    void testNewIncompleteWay() {
 
         Node n1 = new Node(1);
@@ -868,5 +868,5 @@
      */
     @Test
-    public void testIncompleteWayOntoCompleteWay() {
+    void testIncompleteWayOntoCompleteWay() {
 
         // an incomplete node
@@ -923,5 +923,5 @@
      */
     @Test
-    public void testTwoCompleteNodesOntoAnIncompleteWay() {
+    void testTwoCompleteNodesOntoAnIncompleteWay() {
 
         // -- source dataset
@@ -1009,5 +1009,5 @@
      */
     @Test
-    public void testTicket07481ab() {
+    void testTicket07481ab() {
         doTestTicket7481(my, their);
     }
@@ -1017,5 +1017,5 @@
      */
     @Test
-    public void testTicket07481ba() {
+    void testTicket07481ba() {
         doTestTicket7481(their, my);
     }
@@ -1025,5 +1025,5 @@
      */
     @Test
-    public void testTicket12599() {
+    void testTicket12599() {
         // Server node: no modifications
         Node n1 = new Node(1, 1);
@@ -1065,5 +1065,5 @@
      */
     @Test
-    public void testTicket12616() {
+    void testTicket12616() {
         // Server node: no modifications
         Node n1 = new Node(1, 1);
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
@@ -12,6 +12,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
@@ -27,10 +27,10 @@
  * Unit tests for class {@link DataSet}.
  */
-public class DataSetTest {
+class DataSetTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testSearchRelations() {
+    void testSearchRelations() {
         final DataSet ds = new DataSet();
         // null bbox => empty list
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testSearchPrimitives() {
+    void testSearchPrimitives() {
         final DataSet ds = new DataSet();
         // null bbox => empty list
@@ -99,5 +99,5 @@
      */
     @Test
-    public void testChangesetTags() {
+    void testChangesetTags() {
         final DataSet ds = new DataSet();
         assertTrue(ds.getChangeSetTags().isEmpty());
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testAllNonDeleted() {
+    void testAllNonDeleted() {
         final DataSet ds = new DataSet();
         assertTrue(ds.allNonDeletedPrimitives().isEmpty());
@@ -142,5 +142,5 @@
      */
     @Test
-    public void testTicket14186() {
+    void testTicket14186() {
         final DataSet ds = new DataSet();
         Node n1 = new Node(1);
@@ -163,5 +163,5 @@
      */
     @Test
-    public void testTicket19438() {
+    void testTicket19438() {
         final DataSet ds = new DataSet();
         Node n1 = new Node(1);
@@ -184,5 +184,5 @@
      */
     @Test
-    public void testSelectionOrderPreserved() {
+    void testSelectionOrderPreserved() {
         final DataSet ds = new DataSet();
         Node n1 = new Node(1);
@@ -222,5 +222,5 @@
      */
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         DataSet ds = new DataSet();
         assertEqualsDataSet(ds, new DataSet(ds));
@@ -249,5 +249,5 @@
      */
     @Test
-    public void testMergePolicies() {
+    void testMergePolicies() {
         DataSet ds1 = new DataSet();
         DataSet ds2 = new DataSet();
@@ -293,5 +293,5 @@
      */
     @Test
-    public void testEnumOrder() {
+    void testEnumOrder() {
         assertTrue(DownloadPolicy.BLOCKED.compareTo(DownloadPolicy.NORMAL) > 0);
         assertTrue(UploadPolicy.BLOCKED.compareTo(UploadPolicy.NORMAL) > 0);
@@ -304,5 +304,5 @@
      */
     @Test
-    public void testAddDataSourceListener() {
+    void testAddDataSourceListener() {
         DataSourceListener addListener = new DataSourceListener() {
             @Override
@@ -322,5 +322,5 @@
      */
     @Test
-    public void testRemoveDataSourceListener() {
+    void testRemoveDataSourceListener() {
         DataSourceListener removeListener = new DataSourceListener() {
             @Override
@@ -340,5 +340,5 @@
      */
     @Test
-    public void testCloneReadOnly() {
+    void testCloneReadOnly() {
         DataSet ds = new DataSet();
         Node n1 = new Node(LatLon.SOUTH_POLE);
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.InputStream;
@@ -15,6 +15,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -33,15 +33,15 @@
  * Unit tests for class {@link Filter}.
  */
-public class FilterTest {
+class FilterTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
 
     @Test
-    public void testBasic() throws SearchParseError {
+    void testBasic() throws SearchParseError {
         DataSet ds = new DataSet();
         Node n1 = new Node(LatLon.ZERO);
@@ -71,5 +71,5 @@
 
     @Test
-    public void testFilter() throws Exception {
+    void testFilter() throws Exception {
         for (int i : new int[] {1, 2, 3, 11, 12, 13, 14, 15}) {
             DataSet ds;
@@ -197,5 +197,5 @@
      */
     @Test
-    public void testFilterPreferenceEntry() {
+    void testFilterPreferenceEntry() {
         Filter f = new Filter();
         FilterPreferenceEntry fpe = f.getPreferenceEntry();
@@ -243,5 +243,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(FilterPreferenceEntry.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/MultipolygonBuilderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/MultipolygonBuilderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/MultipolygonBuilderTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.io.InputStream;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.io.OsmReader;
@@ -17,10 +17,10 @@
  * Unit tests of the {@code MultipolygonBuilder} class.
  */
-public class MultipolygonBuilderTest {
+class MultipolygonBuilderTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().timeout(15000);
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testTicket12376() throws Exception {
+    void testTicket12376() throws Exception {
         try (InputStream is = TestUtils.getRegressionDataStream(12376, "multipolygon_hang.osm.bz2")) {
             for (Relation r : OsmReader.parseDataSet(is, null).getRelations()) {
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/NodeDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/NodeDataTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/NodeDataTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.ByteArrayInputStream;
@@ -12,10 +12,10 @@
 
 import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
-public class NodeDataTest {
+class NodeDataTest {
 
     @SuppressFBWarnings(value = "OBJECT_DESERIALIZATION")
@@ -31,5 +31,5 @@
 
     @Test
-    public void testSerializationForDragAndDrop() throws Exception {
+    void testSerializationForDragAndDrop() throws Exception {
         final NodeData data = new NodeData();
         data.setCoor(new LatLon(31.14, 15.9));
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testTicket13395() throws Exception {
+    void testTicket13395() throws Exception {
         Node n = new Node(1925320646, 1);
         n.setCoor(null);
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/NodeGraphTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/NodeGraphTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/NodeGraphTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -9,6 +9,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -18,10 +18,10 @@
  * Unit tests of the {@code NodeGraph} class.
  */
-public class NodeGraphTest {
+class NodeGraphTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testNodePairs() {
+    void testNodePairs() {
         assertTrue(NodeGraph.buildNodePairs(Collections.emptyList(), true).isEmpty());
         assertTrue(NodeGraph.buildNodePairs(Collections.emptyList(), false).isEmpty());
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java	(revision 17275)
@@ -2,12 +2,13 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 org.junit.Rule;
-import org.junit.Test;
+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;
@@ -21,10 +22,10 @@
  * Unit tests of the {@code Node} class.
  */
-public class NodeTest {
+class NodeTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -34,5 +35,5 @@
      */
     @Test
-    public void testTicket12060() {
+    void testTicket12060() {
         DataSet ds = new DataSet();
         ds.addDataSource(new DataSource(new Bounds(LatLon.ZERO), null));
@@ -51,5 +52,5 @@
      */
     @Test
-    public void testBBox() {
+    void testBBox() {
         DataSet ds = new DataSet();
         Node n1 = new Node(1);
@@ -85,7 +86,7 @@
      * Test that {@link Node#cloneFrom} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testCloneFromIAE() {
-        new Node().cloneFrom(new Way());
+    @Test
+    void testCloneFromIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new Node().cloneFrom(new Way()));
     }
 
@@ -93,7 +94,7 @@
      * Test that {@link Node#mergeFrom} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testMergeFromIAE() {
-        new Node().mergeFrom(new Way());
+    @Test
+    void testMergeFromIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new Node().mergeFrom(new Way()));
     }
 
@@ -101,7 +102,7 @@
      * Test that {@link Node#load} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testLoadIAE() {
-        new Node().load(new WayData());
+    @Test
+    void testLoadIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new Node().load(new WayData()));
     }
 
@@ -110,5 +111,5 @@
      */
     @Test
-    public void testOutsideWorld() {
+    void testOutsideWorld() {
         Node n = new Node(1, 1);
         n.setCoor(LatLon.ZERO);
@@ -134,5 +135,5 @@
      */
     @Test
-    public void testDirectional() {
+    void testDirectional() {
         assertFalse(OsmUtils.createPrimitive("node oneway=yes").hasDirectionKeys());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/NoteDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/NoteDataTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/NoteDataTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.notes.Note;
@@ -13,5 +13,5 @@
  * Unit tests of the {@code NoteData} class.
  */
-public class NoteDataTest {
+class NoteDataTest {
 
     /**
@@ -19,5 +19,5 @@
      */
     @Test
-    public void testNoteData() {
+    void testNoteData() {
         NoteData empty = new NoteData();
         assertEquals(0, empty.getNotes().size());
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -17,10 +17,10 @@
  * {@link Node} for the tests, {@link OsmPrimitive} is abstract.
  */
-public class OsmPrimitiveKeyHandlingTest {
+class OsmPrimitiveKeyHandlingTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testEmptyNode() {
+    void testEmptyNode() {
         Node n = new Node();
         testKeysSize(n, 0);
@@ -44,5 +44,5 @@
      */
     @Test
-    public void testPut() {
+    void testPut() {
         Node n = new Node();
         n.put("akey", "avalue");
@@ -56,5 +56,5 @@
      */
     @Test
-    public void testPut2() {
+    void testPut2() {
         Node n = new Node();
         n.put("key.1", "value.1");
@@ -74,5 +74,5 @@
     @Test
     @SuppressFBWarnings(value = "DM_STRING_CTOR", justification = "test that equals is used and not ==")
-    public void testRemove() {
+    void testRemove() {
         Node n = new Node();
         n.put("key.1", "value.1");
@@ -106,5 +106,5 @@
      */
     @Test
-    public void testRemoveAll() {
+    void testRemoveAll() {
         Node n = new Node();
 
@@ -121,5 +121,5 @@
      */
     @Test
-    public void testHasEqualSemanticAttributes() {
+    void testHasEqualSemanticAttributes() {
         Node n1 = new Node(1);
         n1.setCoor(LatLon.ZERO);
@@ -139,5 +139,5 @@
      */
     @Test
-    public void testHasEqualSemanticAttributes2() {
+    void testHasEqualSemanticAttributes2() {
         Node n1 = new Node(1);
         n1.setCoor(LatLon.ZERO);
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java	(revision 17275)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.data.osm;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Arrays;
@@ -6,7 +8,7 @@
 
 import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+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.LatLon;
 import org.openstreetmap.josm.data.projection.ProjectionRegistry;
@@ -19,10 +21,10 @@
  * Unit tests of the {@code OsmPrimitive} class.
  */
-public class OsmPrimitiveTest {
+class OsmPrimitiveTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -38,5 +40,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
@@ -44,5 +46,5 @@
 
     @Test
-    public void testSimpleReferrersTest() {
+    void testSimpleReferrersTest() {
         Node n1 = new Node(LatLon.ZERO);
         Way w1 = new Way();
@@ -54,5 +56,5 @@
 
     @Test
-    public void testAddAndRemoveReferrer() {
+    void testAddAndRemoveReferrer() {
         Node n1 = new Node(LatLon.ZERO);
         Node n2 = new Node(LatLon.ZERO);
@@ -70,5 +72,5 @@
 
     @Test
-    public void testMultipleReferrers() {
+    void testMultipleReferrers() {
         Node n1 = new Node(LatLon.ZERO);
         Way w1 = new Way();
@@ -86,5 +88,5 @@
 
     @Test
-    public void testRemoveMemberFromRelationReferrerTest() {
+    void testRemoveMemberFromRelationReferrerTest() {
         Node n1 = new Node(LatLon.ZERO);
         Relation r1 = new Relation();
@@ -98,5 +100,5 @@
 
     @Test
-    public void testSetRelationMemberReferrerTest() {
+    void testSetRelationMemberReferrerTest() {
         Node n1 = new Node(LatLon.ZERO);
         Node n2 = new Node(LatLon.ZERO);
@@ -115,5 +117,5 @@
 
     @Test
-    public void testRemovePrimitiveReferrerTest() {
+    void testRemovePrimitiveReferrerTest() {
         Node n1 = new Node(LatLon.ZERO);
         Way w1 = new Way();
@@ -137,5 +139,5 @@
 
     @Test
-    public void testNodeFromMultipleDatasets() {
+    void testNodeFromMultipleDatasets() {
         // n has two referrers - w1 and w2. But only w1 is returned because it is in the same dataset as n
         Node n = new Node(LatLon.ZERO);
@@ -151,8 +153,8 @@
     }
 
-    @Test(expected = DataIntegrityProblemException.class)
-    public void testCheckMustBeInDatasate() {
+    @Test
+    void testCheckMustBeInDatasate() {
         Node n = new Node();
-        n.getReferrers();
+        assertThrows(DataIntegrityProblemException.class, () -> n.getReferrers());
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTypeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTypeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTypeTest.java	(revision 17275)
@@ -2,12 +2,13 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.util.Collection;
 
-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.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -18,10 +19,10 @@
  * Unit tests of the {@code OsmPrimitiveType} class.
  */
-public class OsmPrimitiveTypeTest {
+class OsmPrimitiveTypeTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -31,5 +32,5 @@
      */
     @Test
-    public void testEnum() {
+    void testEnum() {
         TestUtils.superficialEnumCodeCoverage(OsmPrimitiveType.class);
     }
@@ -39,5 +40,5 @@
      */
     @Test
-    public void testGetApiName() {
+    void testGetApiName() {
         assertEquals("node", OsmPrimitiveType.NODE.getAPIName());
         assertEquals("way", OsmPrimitiveType.WAY.getAPIName());
@@ -49,5 +50,5 @@
      */
     @Test
-    public void testGetOsmClass() {
+    void testGetOsmClass() {
         assertEquals(Node.class, OsmPrimitiveType.NODE.getOsmClass());
         assertEquals(Way.class, OsmPrimitiveType.WAY.getOsmClass());
@@ -61,5 +62,5 @@
      */
     @Test
-    public void testGetDataClass() {
+    void testGetDataClass() {
         assertEquals(NodeData.class, OsmPrimitiveType.NODE.getDataClass());
         assertEquals(WayData.class, OsmPrimitiveType.WAY.getDataClass());
@@ -73,5 +74,5 @@
      */
     @Test
-    public void testFromApiTypeName() {
+    void testFromApiTypeName() {
         assertEquals(OsmPrimitiveType.NODE, OsmPrimitiveType.fromApiTypeName("node"));
         assertEquals(OsmPrimitiveType.WAY, OsmPrimitiveType.fromApiTypeName("way"));
@@ -82,7 +83,7 @@
      * Unit test of {@link OsmPrimitiveType#fromApiTypeName} method - error case.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testFromApiTypeNameError() {
-        OsmPrimitiveType.fromApiTypeName("foo");
+    @Test
+    void testFromApiTypeNameError() {
+        assertThrows(IllegalArgumentException.class, () -> OsmPrimitiveType.fromApiTypeName("foo"));
     }
 
@@ -91,5 +92,5 @@
      */
     @Test
-    public void testFromIPrimitive() {
+    void testFromIPrimitive() {
         assertEquals(OsmPrimitiveType.NODE, OsmPrimitiveType.from(new Node()));
         assertEquals(OsmPrimitiveType.WAY, OsmPrimitiveType.from(new Way()));
@@ -100,7 +101,7 @@
      * Unit test of {@link OsmPrimitiveType#from(IPrimitive)} method - error case.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testFromIPrimitiveError() {
-        OsmPrimitiveType.from((IPrimitive) null);
+    @Test
+    void testFromIPrimitiveError() {
+        assertThrows(IllegalArgumentException.class, () -> OsmPrimitiveType.from((IPrimitive) null));
     }
 
@@ -109,5 +110,5 @@
      */
     @Test
-    public void testFromString() {
+    void testFromString() {
         assertEquals(OsmPrimitiveType.NODE, OsmPrimitiveType.from("node"));
         assertEquals(OsmPrimitiveType.WAY, OsmPrimitiveType.from("WAY"));
@@ -122,5 +123,5 @@
      */
     @Test
-    public void testDataValues() {
+    void testDataValues() {
         Collection<OsmPrimitiveType> values = OsmPrimitiveType.dataValues();
         assertEquals(3, values.size());
@@ -134,5 +135,5 @@
      */
     @Test
-    public void testNewInstance() {
+    void testNewInstance() {
         OsmPrimitive n = OsmPrimitiveType.NODE.newInstance(1, false);
         OsmPrimitive w = OsmPrimitiveType.WAY.newInstance(2, false);
@@ -151,7 +152,7 @@
      * Unit test of {@link OsmPrimitiveType#newInstance} method - error case.
      */
-    @Test(expected = AssertionError.class)
-    public void testNewInstanceError() {
-        OsmPrimitiveType.CLOSEDWAY.newInstance(1, false);
+    @Test
+    void testNewInstanceError() {
+        assertThrows(AssertionError.class, () -> OsmPrimitiveType.CLOSEDWAY.newInstance(1, false));
     }
 
@@ -160,5 +161,5 @@
      */
     @Test
-    public void testNewVersionedInstance() {
+    void testNewVersionedInstance() {
         OsmPrimitive n = OsmPrimitiveType.NODE.newVersionedInstance(1, 4);
         OsmPrimitive w = OsmPrimitiveType.WAY.newVersionedInstance(2, 5);
@@ -181,7 +182,7 @@
      * Unit test of {@link OsmPrimitiveType#newVersionedInstance} method - error case.
      */
-    @Test(expected = AssertionError.class)
-    public void testNewVersionedInstanceError() {
-        OsmPrimitiveType.CLOSEDWAY.newVersionedInstance(1, 0);
+    @Test
+    void testNewVersionedInstanceError() {
+        assertThrows(AssertionError.class, () -> OsmPrimitiveType.CLOSEDWAY.newVersionedInstance(1, 0));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/OsmUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/OsmUtilsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/OsmUtilsTest.java	(revision 17275)
@@ -2,14 +2,15 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+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 java.util.Arrays;
 import java.util.stream.Collectors;
 
-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.testutils.JOSMTestRules;
 
@@ -19,10 +20,10 @@
  * Unit tests for class {@link OsmUtils}.
  */
-public class OsmUtilsTest {
+class OsmUtilsTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -32,5 +33,5 @@
      */
     @Test
-    public void testCreatePrimitive() {
+    void testCreatePrimitive() {
         final OsmPrimitive p = OsmUtils.createPrimitive("way name=Foo railway=rail");
         assertTrue(p instanceof Way);
@@ -44,5 +45,5 @@
      */
     @Test
-    public void testArea() {
+    void testArea() {
         final OsmPrimitive p = OsmUtils.createPrimitive("area name=Foo railway=rail");
         assertEquals(OsmPrimitiveType.WAY, p.getType());
@@ -53,7 +54,7 @@
      * Unit test of {@link OsmUtils#createPrimitive}
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testCreatePrimitiveFail() {
-        OsmUtils.createPrimitive("noway name=Foo");
+    @Test
+    void testCreatePrimitiveFail() {
+        assertThrows(IllegalArgumentException.class, () -> OsmUtils.createPrimitive("noway name=Foo"));
     }
 
@@ -62,5 +63,5 @@
      */
     @Test
-    public void testSplitMultipleValues() {
+    void testSplitMultipleValues() {
         // examples from https://wiki.openstreetmap.org/wiki/Semi-colon_value_separator
         assertEquals(Arrays.asList("B500", "B550"), OsmUtils.splitMultipleValues("B500;B550").collect(Collectors.toList()));
@@ -74,5 +75,5 @@
      */
     @Test
-    public void testTrueFalse() {
+    void testTrueFalse() {
         assertFalse(OsmUtils.isTrue(null));
         assertFalse(OsmUtils.isFalse(null));
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 17275)
@@ -16,6 +16,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+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.projection.ProjectionRegistry;
@@ -30,10 +30,10 @@
  * Unit tests of {@link QuadBuckets}.
  */
-public class QuadBucketsTest {
+class QuadBucketsTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -83,5 +83,5 @@
      */
     @Test
-    public void testRemove() throws Exception {
+    void testRemove() throws Exception {
         ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
         try (InputStream fis = Files.newInputStream(Paths.get("nodist/data/restriction.osm"))) {
@@ -96,5 +96,5 @@
      */
     @Test
-    public void testMove() throws Exception {
+    void testMove() throws Exception {
         ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
         try (InputStream fis = Files.newInputStream(Paths.get("nodist/data/restriction.osm"))) {
@@ -113,5 +113,5 @@
      */
     @Test
-    public void testSpecialBBox() {
+    void testSpecialBBox() {
         QuadBuckets<Node> qbNodes = new QuadBuckets<>();
         QuadBuckets<Way> qbWays = new QuadBuckets<>();
@@ -195,5 +195,5 @@
      */
     @Test
-    public void testSplitsWithIncompleteData() {
+    void testSplitsWithIncompleteData() {
         DataSet ds = new DataSet();
         long nodeId = 1;
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/RelationTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/RelationTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/RelationTest.java	(revision 17275)
@@ -2,11 +2,12 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import org.junit.Assert;
-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.data.coor.LatLon;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,20 +15,20 @@
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
-public class RelationTest {
+class RelationTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
 
-    @Test(expected = NullPointerException.class)
-    public void testCreateNewRelation() {
-        new Relation(null);
+    @Test
+    void testCreateNewRelation() {
+        assertThrows(NullPointerException.class, () -> new Relation(null));
     }
 
     @Test
-    public void testEqualSemanticsToNull() {
+    void testEqualSemanticsToNull() {
         Relation relation = new Relation();
         assertFalse(relation.hasEqualTechnicalAttributes(null));
@@ -35,5 +36,5 @@
 
     @Test
-    public void testBbox() {
+    void testBbox() {
         DataSet ds = new DataSet();
 
@@ -88,5 +89,5 @@
 
     @Test
-    public void testBBoxNotInDataset() {
+    void testBBoxNotInDataset() {
         Node n1 = new Node(new LatLon(10, 10));
         Node n2 = new Node(new LatLon(20, 20));
@@ -122,5 +123,5 @@
      */
     @Test
-    public void testTicket12467() throws Exception {
+    void testTicket12467() throws Exception {
         Relation r = new Relation();
         r.put("type", "boundary");
@@ -143,7 +144,7 @@
      * Test that {@link Relation#cloneFrom} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testCloneFromIAE() {
-        new Relation().cloneFrom(new Node());
+    @Test
+    void testCloneFromIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new Relation().cloneFrom(new Node()));
     }
 
@@ -151,7 +152,7 @@
      * Test that {@link Relation#load} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testLoadIAE() {
-        new Relation().load(new NodeData());
+    @Test
+    void testLoadIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new Relation().load(new NodeData()));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/SimplePrimitiveIdTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/SimplePrimitiveIdTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/SimplePrimitiveIdTest.java	(revision 17275)
@@ -2,12 +2,13 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link SimplePrimitiveId} class.
  */
-public class SimplePrimitiveIdTest {
+class SimplePrimitiveIdTest {
 
     /**
@@ -15,5 +16,5 @@
      */
     @Test
-    public void testFromStringNode() {
+    void testFromStringNode() {
         assertEquals(new SimplePrimitiveId(123, OsmPrimitiveType.NODE), SimplePrimitiveId.fromString("node/123"));
         assertEquals(new SimplePrimitiveId(123, OsmPrimitiveType.NODE), SimplePrimitiveId.fromString("n123"));
@@ -26,5 +27,5 @@
      */
     @Test
-    public void testFromStringWay() {
+    void testFromStringWay() {
         assertEquals(new SimplePrimitiveId(123, OsmPrimitiveType.WAY), SimplePrimitiveId.fromString("way/123"));
         assertEquals(new SimplePrimitiveId(123, OsmPrimitiveType.WAY), SimplePrimitiveId.fromString("w123"));
@@ -37,5 +38,5 @@
      */
     @Test
-    public void testFromStringRelation() {
+    void testFromStringRelation() {
         assertEquals(new SimplePrimitiveId(123, OsmPrimitiveType.RELATION), SimplePrimitiveId.fromString("relation/123"));
         assertEquals(new SimplePrimitiveId(123, OsmPrimitiveType.RELATION), SimplePrimitiveId.fromString("r123"));
@@ -47,7 +48,7 @@
      * Unit test of {@link SimplePrimitiveId#fromString} for invalid input.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testFromStringBad() {
-        SimplePrimitiveId.fromString("foobar");
+    @Test
+    void testFromStringBad() {
+        assertThrows(IllegalArgumentException.class, () -> SimplePrimitiveId.fromString("foobar"));
     }
 
@@ -56,5 +57,5 @@
      */
     @Test
-    public void testFuzzyParse() {
+    void testFuzzyParse() {
         assertEquals("[relation 123]",
                 SimplePrimitiveId.fuzzyParse("foo relation/123 bar").toString());
@@ -68,5 +69,5 @@
 
     @Test
-    public void testFromCopyAction() {
+    void testFromCopyAction() {
         assertEquals(new SimplePrimitiveId(123, OsmPrimitiveType.NODE), SimplePrimitiveId.fromString("node 123"));
         assertEquals(new SimplePrimitiveId(123, OsmPrimitiveType.WAY), SimplePrimitiveId.fromString("way 123"));
@@ -78,5 +79,5 @@
      */
     @Test
-    public void testMultipleFromString() {
+    void testMultipleFromString() {
         assertEquals("[node 234]", SimplePrimitiveId.multipleFromString("node/234").toString());
         assertEquals("[node 234]", SimplePrimitiveId.multipleFromString("node/234-234").toString());
@@ -101,7 +102,7 @@
      * Unit test of {@link SimplePrimitiveId#multipleFromString} for invalid data.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testMultipleFromStringBad() {
-        SimplePrimitiveId.multipleFromString("foo node123 bar");
+    @Test
+    void testMultipleFromStringBad() {
+        assertThrows(IllegalArgumentException.class, () -> SimplePrimitiveId.multipleFromString("foo node123 bar"));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/StorageTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/StorageTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/StorageTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.osm;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests for class {@link Storage}.
  */
-public class StorageTest {
+class StorageTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(Storage.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/TagCollectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/TagCollectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/TagCollectionTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -17,6 +17,6 @@
 import java.util.stream.Stream;
 
-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.testutils.JOSMTestRules;
 
@@ -27,5 +27,5 @@
  * @author Michael Zangl
  */
-public class TagCollectionTest {
+class TagCollectionTest {
     private final Tag tagA = new Tag("k", "v");
     private final Tag tagB = new Tag("k", "b");
@@ -39,5 +39,5 @@
      * We need prefs for using primitives
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -54,5 +54,5 @@
      */
     @Test
-    public void testFromTagged() {
+    void testFromTagged() {
         TagCollection c = TagCollection.from(tagA);
         assertTagCounts(c, 1, 0, 0, 0);
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testFromMapOfStringString() {
+    void testFromMapOfStringString() {
         TagCollection c = TagCollection.from(tagA.getKeys());
         assertTagCounts(c, 1, 0, 0, 0);
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testUnionOfAllPrimitivesCollectionOfQextendsTagged() {
+    void testUnionOfAllPrimitivesCollectionOfQextendsTagged() {
         TagCollection c = TagCollection.unionOfAllPrimitives(Arrays.asList(tagA));
         assertEquals(1, c.getTagOccurrence(tagA));
@@ -111,5 +111,5 @@
      */
     @Test
-    public void testTagCollection() {
+    void testTagCollection() {
         TagCollection c = new TagCollection();
         assertTagCounts(c, 0, 0, 0, 0);
@@ -120,5 +120,5 @@
      */
     @Test
-    public void testTagCollectionTagCollection() {
+    void testTagCollectionTagCollection() {
         TagCollection blueprint = TagCollection.unionOfAllPrimitives(Arrays.asList(tagA, tagC, tagC));
         TagCollection c = new TagCollection(blueprint);
@@ -133,5 +133,5 @@
      */
     @Test
-    public void testTagCollectionCollectionOfTag() {
+    void testTagCollectionCollectionOfTag() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagC));
         assertTagCounts(c, 1, 0, 2, 0);
@@ -145,5 +145,5 @@
      */
     @Test
-    public void testSize() {
+    void testSize() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagC));
         assertEquals(2, c.size());
@@ -157,5 +157,5 @@
      */
     @Test
-    public void testIsEmpty() {
+    void testIsEmpty() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagC));
         assertFalse(c.isEmpty());
@@ -169,5 +169,5 @@
      */
     @Test
-    public void testAddTag() {
+    void testAddTag() {
         TagCollection c = new TagCollection();
         assertTagCounts(c, 0, 0, 0, 0);
@@ -182,8 +182,8 @@
 
     /**
-     * Test method for {@link TagCollection#getTagOccurence(Tag)}.
-     */
-    @Test
-    public void testGetTagCount() {
+     * Test method for {@link TagCollection#getTagOccurrence}.
+     */
+    @Test
+    void testGetTagCount() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagC));
         assertEquals(2, c.getTagOccurrence(tagC));
@@ -197,5 +197,5 @@
      */
     @Test
-    public void testAddCollectionOfTag() {
+    void testAddCollectionOfTag() {
         TagCollection c = new TagCollection();
         assertTagCounts(c, 0, 0, 0, 0);
@@ -214,5 +214,5 @@
      */
     @Test
-    public void testAddTagCollection() {
+    void testAddTagCollection() {
         TagCollection c = new TagCollection();
         assertTagCounts(c, 0, 0, 0, 0);
@@ -231,5 +231,5 @@
      */
     @Test
-    public void testRemoveTag() {
+    void testRemoveTag() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagC));
         assertTagCounts(c, 1, 0, 2, 0);
@@ -246,5 +246,5 @@
      */
     @Test
-    public void testRemoveCollectionOfTag() {
+    void testRemoveCollectionOfTag() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagC));
         assertTagCounts(c, 1, 0, 2, 0);
@@ -259,5 +259,5 @@
      */
     @Test
-    public void testRemoveTagCollection() {
+    void testRemoveTagCollection() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagC));
         assertTagCounts(c, 1, 0, 2, 0);
@@ -274,5 +274,5 @@
      */
     @Test
-    public void testRemoveByKeyString() {
+    void testRemoveByKeyString() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagB, tagB, tagC));
         assertTagCounts(c, 1, 2, 1, 0);
@@ -287,5 +287,5 @@
      */
     @Test
-    public void testRemoveByKeyCollectionOfString() {
+    void testRemoveByKeyCollectionOfString() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagB, tagB, tagC, tagD));
         assertTagCounts(c, 1, 2, 1, 1);
@@ -300,5 +300,5 @@
      */
     @Test
-    public void testContains() {
+    void testContains() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagB, tagB));
         assertTrue(c.contains(tagA));
@@ -311,5 +311,5 @@
      */
     @Test
-    public void testContainsAll() {
+    void testContainsAll() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagB, tagB));
         assertTrue(c.containsAll(Arrays.asList(tagA, tagB)));
@@ -323,5 +323,5 @@
      */
     @Test
-    public void testContainsAllKeys() {
+    void testContainsAllKeys() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagB, tagC));
         assertTrue(c.containsAllKeys(Arrays.asList("k", "k2")));
@@ -335,5 +335,5 @@
      */
     @Test
-    public void testGetNumTagsFor() {
+    void testGetNumTagsFor() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagB, tagC));
         assertEquals(2, c.getNumTagsFor("k"));
@@ -346,5 +346,5 @@
      */
     @Test
-    public void testHasTagsFor() {
+    void testHasTagsFor() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagB, tagC));
         assertTrue(c.hasTagsFor("k"));
@@ -357,5 +357,5 @@
      */
     @Test
-    public void testHasValuesFor() {
+    void testHasValuesFor() {
         TagCollection c = new TagCollection(Arrays.asList(tagC, tagEmpty));
         assertFalse(c.hasValuesFor("k"));
@@ -368,5 +368,5 @@
      */
     @Test
-    public void testHasUniqueNonEmptyValue() {
+    void testHasUniqueNonEmptyValue() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagEmpty));
         assertTrue(c.hasUniqueNonEmptyValue("k"));
@@ -384,5 +384,5 @@
      */
     @Test
-    public void testHasEmptyValue() {
+    void testHasEmptyValue() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC, tagEmpty));
         assertTrue(c.hasEmptyValue("k"));
@@ -395,5 +395,5 @@
      */
     @Test
-    public void testHasUniqueEmptyValue() {
+    void testHasUniqueEmptyValue() {
         TagCollection c = new TagCollection(Arrays.asList(tagC, tagEmpty));
         assertTrue(c.hasUniqueEmptyValue("k"));
@@ -411,5 +411,5 @@
      */
     @Test
-    public void testGetTagsForString() {
+    void testGetTagsForString() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagB, tagC, tagEmpty));
         TagCollection collection = d.getTagsFor("k");
@@ -422,5 +422,5 @@
      */
     @Test
-    public void testGetTagsForCollectionOfString() {
+    void testGetTagsForCollectionOfString() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagB, tagC, tagEmpty));
         TagCollection collection = d.getTagsFor(Arrays.asList("k", "k2"));
@@ -433,5 +433,5 @@
      */
     @Test
-    public void testAsSet() {
+    void testAsSet() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagB, tagC, tagC));
         Set<Tag> set = d.asSet();
@@ -446,5 +446,5 @@
      */
     @Test
-    public void testAsList() {
+    void testAsList() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagB, tagC, tagC));
         List<Tag> set = d.asList();
@@ -459,5 +459,5 @@
      */
     @Test
-    public void testIterator() {
+    void testIterator() {
         TagCollection d = new TagCollection(Arrays.asList(tagA));
         Iterator<Tag> it = d.iterator();
@@ -471,5 +471,5 @@
      */
     @Test
-    public void testGetKeys() {
+    void testGetKeys() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagB, tagC, tagC));
         Set<String> set = d.getKeys();
@@ -483,5 +483,5 @@
      */
     @Test
-    public void testGetKeysWithMultipleValues() {
+    void testGetKeysWithMultipleValues() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagB, tagC, tagC));
         Set<String> set = d.getKeysWithMultipleValues();
@@ -494,5 +494,5 @@
      */
     @Test
-    public void testSetUniqueForKeyTag() {
+    void testSetUniqueForKeyTag() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagA, tagB, tagC, tagC));
         assertTagCounts(d, 2, 1, 2, 0);
@@ -505,5 +505,5 @@
      */
     @Test
-    public void testSetUniqueForKeyStringString() {
+    void testSetUniqueForKeyStringString() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagA, tagB, tagC, tagC));
         assertTagCounts(d, 2, 1, 2, 0);
@@ -516,5 +516,5 @@
      */
     @Test
-    public void testGetValues() {
+    void testGetValues() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagA, tagB, tagC, tagEmpty));
         Set<String> set = d.getValues();
@@ -529,5 +529,5 @@
      */
     @Test
-    public void testGetValuesString() {
+    void testGetValuesString() {
         TagCollection d = new TagCollection(Arrays.asList(tagA, tagA, tagC, tagEmpty));
         Set<String> set = d.getValues("k");
@@ -541,5 +541,5 @@
      */
     @Test
-    public void testIsApplicableToPrimitive() {
+    void testIsApplicableToPrimitive() {
         TagCollection c = new TagCollection();
         assertTrue(c.isApplicableToPrimitive());
@@ -554,5 +554,5 @@
      */
     @Test
-    public void testApplyToTagged() {
+    void testApplyToTagged() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC));
         NodeData tagged = new NodeData();
@@ -572,5 +572,5 @@
      */
     @Test
-    public void testApplyToCollectionOfQextendsTagged() {
+    void testApplyToCollectionOfQextendsTagged() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC));
         NodeData tagged = new NodeData();
@@ -590,5 +590,5 @@
      */
     @Test
-    public void testReplaceTagsOfTagged() {
+    void testReplaceTagsOfTagged() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC));
         NodeData tagged = new NodeData();
@@ -605,5 +605,5 @@
      */
     @Test
-    public void testReplaceTagsOfCollectionOfQextendsTagged() {
+    void testReplaceTagsOfCollectionOfQextendsTagged() {
         TagCollection c = new TagCollection(Arrays.asList(tagA, tagC));
         NodeData tagged = new NodeData();
@@ -623,5 +623,5 @@
      */
     @Test
-    public void testIntersect() {
+    void testIntersect() {
         TagCollection c1 = new TagCollection(Arrays.asList(tagA, tagC, tagD, tagEmpty));
         TagCollection c2 = new TagCollection(Arrays.asList(tagA, tagB, tagD));
@@ -636,5 +636,5 @@
      */
     @Test
-    public void testMinus() {
+    void testMinus() {
         TagCollection c1 = new TagCollection(Arrays.asList(tagA, tagC, tagD, tagEmpty));
         TagCollection c2 = new TagCollection(Arrays.asList(tagA, tagB, tagD));
@@ -649,5 +649,5 @@
      */
     @Test
-    public void testUnion() {
+    void testUnion() {
         TagCollection c1 = new TagCollection(Arrays.asList(tagA, tagC, tagD, tagEmpty));
         TagCollection c2 = new TagCollection(Arrays.asList(tagA, tagB, tagD));
@@ -664,5 +664,5 @@
      */
     @Test
-    public void testEmptyTagsForKeysMissingIn() {
+    void testEmptyTagsForKeysMissingIn() {
         TagCollection c1 = new TagCollection(Arrays.asList(tagA, tagC, tagD, tagEmpty));
         TagCollection c2 = new TagCollection(Arrays.asList(tagA, tagB, tagD));
@@ -677,5 +677,5 @@
      */
     @Test
-    public void testGetJoinedValues() {
+    void testGetJoinedValues() {
         TagCollection c = new TagCollection(Arrays.asList(new Tag("k", "a")));
         assertEquals("a", c.getJoinedValues("k"));
@@ -696,5 +696,5 @@
      */
     @Test
-    public void testGetSummedValues() {
+    void testGetSummedValues() {
         TagCollection c = new TagCollection(Arrays.asList(new Tag("k", "10"), new Tag("k", "20")));
         assertEquals("30", c.getSummedValues("k"));
@@ -711,5 +711,5 @@
      */
     @Test
-    public void testCommonToAllPrimitives() {
+    void testCommonToAllPrimitives() {
         Tagged t1 = new Node();
         t1.put("k1", "10");
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/TagMapTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/TagMapTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/TagMapTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of the {@code TagMap} class.
  */
-public class TagMapTest {
+class TagMapTest {
 
     /**
@@ -15,5 +15,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("TagMap[]", new TagMap().toString());
         assertEquals("TagMap[key=val]", new TagMap(new String[]{"key", "val"}).toString());
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/UserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/UserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/UserTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -15,10 +15,10 @@
  * Tests of {@link User}.
  */
-public class UserTest {
+class UserTest {
 
     /**
      * Setup test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testCreateOsmUser() {
+    void testCreateOsmUser() {
         User user1 = User.createOsmUser(1, "name1");
         assertEquals(1, user1.getId());
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/WayDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/WayDataTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/WayDataTest.java	(revision 17275)
@@ -9,13 +9,13 @@
 
 import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
-public class WayDataTest {
+class WayDataTest {
 
     @Test
     @SuppressFBWarnings(value = "OBJECT_DESERIALIZATION")
-    public void testSerializationForDragAndDrop() throws Exception {
+    void testSerializationForDragAndDrop() throws Exception {
         final WayData data = new WayData();
         data.setNodeIds(Arrays.asList(1415L, 9265L, 3589L, 7932L, 3846L));
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/WaySegmentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/WaySegmentTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/WaySegmentTest.java	(revision 17275)
@@ -5,6 +5,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -15,15 +15,15 @@
  * Unit tests of the {@code WaySegment} class.
  */
-public class WaySegmentTest {
+class WaySegmentTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
 
     @Test
-    public void testForNodePair() throws Exception {
+    void testForNodePair() throws Exception {
         final DataSet ds = new DataSet();
         final Node n1 = new Node(LatLon.ZERO);
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/WayTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/WayTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/WayTest.java	(revision 17275)
@@ -2,13 +2,14 @@
 package org.openstreetmap.josm.data.osm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Arrays;
 import java.util.HashSet;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -18,10 +19,10 @@
  * @since 11270
  */
-public class WayTest {
+class WayTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +33,5 @@
      */
     @Test
-    public void testBBox() {
+    void testBBox() {
         DataSet ds = new DataSet();
         Node n1 = new Node(1);
@@ -61,5 +62,5 @@
      */
     @Test
-    public void testRemoveNode() {
+    void testRemoveNode() {
         DataSet ds = new DataSet();
         Node n1 = new Node(1);
@@ -87,5 +88,4 @@
         way.removeNode(n1);
         assertEquals(Arrays.asList(n2, n3, n4, n2), way.getNodes());
-
     }
 
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testRemoveNodes() {
+    void testRemoveNodes() {
         DataSet ds = new DataSet();
         Node n1 = new Node(1);
@@ -123,7 +123,7 @@
      * Test that {@link Way#cloneFrom} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testCloneFromIAE() {
-        new Way().cloneFrom(new Node());
+    @Test
+    void testCloneFromIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new Way().cloneFrom(new Node()));
     }
 
@@ -131,7 +131,7 @@
      * Test that {@link Way#load} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testLoadIAE() {
-        new Way().load(new NodeData());
+    @Test
+    void testLoadIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new Way().load(new NodeData()));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/ChangesetIdChangedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/ChangesetIdChangedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/ChangesetIdChangedEventTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link ChangesetIdChangedEvent} class.
  */
-public class ChangesetIdChangedEventTest {
+class ChangesetIdChangedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("CHANGESET_ID_CHANGED", new ChangesetIdChangedEvent(null, null, 0, 0).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataChangedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataChangedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataChangedEventTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link DataChangedEvent} class.
  */
-public class DataChangedEventTest {
+class DataChangedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("DATA_CHANGED", new DataChangedEvent(null).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataSourceAddedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataSourceAddedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataSourceAddedEventTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 import java.util.stream.Stream;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
@@ -19,10 +19,10 @@
  * @author Taylor Smock
  */
-public class DataSourceAddedEventTest {
+class DataSourceAddedEventTest {
     /**
      * Get getting the originating data source
      */
     @Test
-    public void testGetDataEventSource() {
+    void testGetDataEventSource() {
         DataSource fakeAdd = new DataSource(new Bounds(0, 0, 0, 0), "fake-source");
         DataSet ds = new DataSet();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testGetAddedSource() {
+    void testGetAddedSource() {
         DataSource fakeAdd = new DataSource(new Bounds(0, 0, 0, 0), "fake-source");
         assertTrue(
@@ -49,5 +49,5 @@
      */
     @Test
-    public void testGetRemovedSource() {
+    void testGetRemovedSource() {
         DataSource fakeAdd = new DataSource(new Bounds(0, 0, 0, 0), "fake-source");
         assertTrue(
@@ -64,5 +64,5 @@
      */
     @Test
-    public void testGetDataSources() {
+    void testGetDataSources() {
         DataSource fakeAdd = new DataSource(new Bounds(0, 0, 0, 0), "fake-source");
         DataSourceChangeEvent event = new DataSourceAddedEvent(new DataSet(), Collections.emptySet(),
@@ -76,5 +76,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         String toString = new DataSourceAddedEvent(new DataSet(), Collections.emptySet(), Stream.empty()).toString();
         assertTrue(toString.contains("added"));
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataSourceRemovedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataSourceRemovedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/DataSourceRemovedEventTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 import java.util.stream.Stream;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
@@ -21,10 +21,10 @@
  */
 
-public class DataSourceRemovedEventTest {
+class DataSourceRemovedEventTest {
     /**
      * Get getting the originating data source
      */
     @Test
-    public void testGetDataEventSource() {
+    void testGetDataEventSource() {
         DataSource fakeRemove = new DataSource(new Bounds(0, 0, 0, 0), "fake-source");
         DataSet ds = new DataSet();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testGetAddedSource() {
+    void testGetAddedSource() {
         DataSource fakeRemove = new DataSource(new Bounds(0, 0, 0, 0), "fake-source");
         assertTrue(
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testGetRemovedSource() {
+    void testGetRemovedSource() {
         DataSource fakeRemove = new DataSource(new Bounds(0, 0, 0, 0), "fake-source");
         assertTrue(new DataSourceRemovedEvent(new DataSet(), Collections.emptySet(), Stream.empty()).getRemoved()
@@ -66,5 +66,5 @@
      */
     @Test
-    public void testGetDataSources() {
+    void testGetDataSources() {
         DataSource fakeRemove = new DataSource(new Bounds(0, 0, 0, 0), "fake-source");
         DataSourceChangeEvent event = new DataSourceRemovedEvent(new DataSet(), Collections.emptySet(),
@@ -83,5 +83,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         String toString = new DataSourceRemovedEvent(new DataSet(), Collections.emptySet(), Stream.empty()).toString();
         assertTrue(toString.contains("added"));
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/NodeMovedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/NodeMovedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/NodeMovedEventTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link NodeMovedEvent} class.
  */
-public class NodeMovedEventTest {
+class NodeMovedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("NODE_MOVED", new NodeMovedEvent(null, null).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitiveFlagsChangedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitiveFlagsChangedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitiveFlagsChangedEventTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link PrimitiveFlagsChangedEvent} class.
  */
-public class PrimitiveFlagsChangedEventTest {
+class PrimitiveFlagsChangedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("PRIMITIVE_FLAGS_CHANGED", new PrimitiveFlagsChangedEvent(null, null).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitivesAddedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitivesAddedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitivesAddedEventTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -15,10 +15,10 @@
  * Unit tests of {@link PrimitivesAddedEvent} class.
  */
-public class PrimitivesAddedEventTest {
+class PrimitivesAddedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("PRIMITIVES_ADDED", new PrimitivesAddedEvent(null, Collections.emptyList(), false).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitivesRemovedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitivesRemovedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/PrimitivesRemovedEventTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -15,10 +15,10 @@
  * Unit tests of {@link PrimitivesRemovedEvent} class.
  */
-public class PrimitivesRemovedEventTest {
+class PrimitivesRemovedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("PRIMITIVES_REMOVED", new PrimitivesRemovedEvent(null, Collections.emptyList(), false).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/RelationMembersChangedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/RelationMembersChangedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/RelationMembersChangedEventTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link RelationMembersChangedEvent} class.
  */
-public class RelationMembersChangedEventTest {
+class RelationMembersChangedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("RELATION_MEMBERS_CHANGED", new RelationMembersChangedEvent(null, null).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
@@ -9,6 +9,6 @@
 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.CommandTest.CommandTestDataWithRelation;
 import org.openstreetmap.josm.data.osm.DataSelectionListener;
@@ -25,5 +25,5 @@
  * @since 12048
  */
-public class SelectionEventManagerTest {
+class SelectionEventManagerTest {
     private final class SelectionListener implements DataSelectionListener {
         private Collection<? extends OsmPrimitive> newSelection;
@@ -42,5 +42,5 @@
     /**
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -50,5 +50,5 @@
      */
     @Test
-    public void testEventPropagation() {
+    void testEventPropagation() {
         // automatically adds the layers
         CommandTestDataWithRelation testData1 = new CommandTestDataWithRelation();
@@ -99,5 +99,5 @@
         GuiHelper.runInEDTAndWait(() -> { });
         for (SelectionListener listener : listeners) {
-            assertEquals(listener.name, should, listener.newSelection);
+            assertEquals(should, listener.newSelection, listener.name);
             listener.newSelection = null;
         }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/TagsChangedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/TagsChangedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/TagsChangedEventTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link TagsChangedEvent} class.
  */
-public class TagsChangedEventTest {
+class TagsChangedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("TAGS_CHANGED", new TagsChangedEvent(null, null, null).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/event/WayNodesChangedEventTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/event/WayNodesChangedEventTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/event/WayNodesChangedEventTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm.event;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link WayNodesChangedEvent} class.
  */
-public class WayNodesChangedEventTest {
+class WayNodesChangedEventTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("WAY_NODES_CHANGED", new WayNodesChangedEvent(null, null).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.osm.history;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Date;
@@ -9,6 +9,6 @@
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.DefaultNameFormatter;
@@ -23,10 +23,10 @@
  * Unit tests for class {@link HistoryNode}.
  */
-public class HistoryNodeTest {
+class HistoryNodeTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testHistoryNode() {
+    void testHistoryNode() {
         Date d = new Date();
         HistoryNode node = create(d);
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testGetType() {
+    void testGetType() {
         assertEquals(OsmPrimitiveType.NODE, create(new Date()).getType());
     }
@@ -73,5 +73,5 @@
      */
     @Test
-    public void testGetCoords() {
+    void testGetCoords() {
         Node n = new Node(new LatLon(45, 0));
         n.setOsmId(1, 2);
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testGetDisplayName() {
+    void testGetDisplayName() {
         HistoryNode node = create(new Date());
         HistoryNameFormatter hnf = DefaultNameFormatter.getInstance();
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryRelationTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryRelationTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryRelationTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.osm.history;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Date;
@@ -9,6 +9,6 @@
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -22,10 +22,10 @@
  * Unit tests for class {@link HistoryRelation}.
  */
-public class HistoryRelationTest {
+class HistoryRelationTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testHistoryRelation() {
+    void testHistoryRelation() {
         Date d = new Date();
         HistoryRelation rel = create(d);
@@ -63,5 +63,5 @@
      */
     @Test
-    public void testGetType() {
+    void testGetType() {
         assertEquals(OsmPrimitiveType.RELATION, create(new Date()).getType());
     }
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testGetDisplayName() {
+    void testGetDisplayName() {
         HistoryNameFormatter hnf = DefaultNameFormatter.getInstance();
         HistoryRelation rel0 = create(new Date()); // 0 member
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.osm.history;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.Date;
@@ -11,6 +11,6 @@
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -24,10 +24,10 @@
  * Unit tests for class {@link HistoryWay}.
  */
-public class HistoryWayTest {
+class HistoryWayTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testHistoryWay() {
+    void testHistoryWay() {
         Date d = new Date();
         HistoryWay way = create(d);
@@ -67,10 +67,10 @@
      */
     @Test
-    public void testGetType() {
+    void testGetType() {
         assertEquals(OsmPrimitiveType.WAY, create(new Date()).getType());
     }
 
     @Test
-    public void testNodeManipulation() {
+    void testNodeManipulation() {
         HistoryWay way = create(new Date());
 
@@ -92,5 +92,5 @@
 
     @Test
-    public void testIterating() {
+    void testIterating() {
         HistoryWay way = create(new Date());
 
@@ -108,5 +108,5 @@
      */
     @Test
-    public void testGetDisplayName() {
+    void testGetDisplayName() {
         HistoryNameFormatter hnf = DefaultNameFormatter.getInstance();
         HistoryWay way0 = create(new Date()); // no node
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/search/PushbackTokenizerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/search/PushbackTokenizerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/search/PushbackTokenizerTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.osm.search;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.search.PushbackTokenizer.Token;
@@ -13,10 +13,10 @@
  * Unit tests for class {@link SearchCompiler}.
  */
-public class PushbackTokenizerTest {
+class PushbackTokenizerTest {
 
     /**
      * Setup rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testEnumToken() {
+    void testEnumToken() {
         TestUtils.superficialEnumCodeCoverage(Token.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.osm.search;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 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;
 import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.lang.reflect.Field;
@@ -19,6 +19,6 @@
 
 import org.junit.Assert;
-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.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -53,10 +53,10 @@
  * Unit tests for class {@link SearchCompiler}.
  */
-public class SearchCompilerTest {
+class SearchCompilerTest {
 
     /**
      * We need prefs for this. We access preferences when creating OSM primitives.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().timeout(30000);
@@ -95,9 +95,9 @@
         private void match(OsmPrimitive p, boolean cond) {
             if (cond) {
-                assertTrue(p.toString(), m.match(p));
-                assertFalse(p.toString(), n.match(p));
+                assertTrue(m.match(p), p::toString);
+                assertFalse(n.match(p), p::toString);
             } else {
-                assertFalse(p.toString(), m.match(p));
-                assertTrue(p.toString(), n.match(p));
+                assertFalse(m.match(p), p::toString);
+                assertTrue(n.match(p), p::toString);
             }
         }
@@ -109,5 +109,5 @@
      */
     @Test
-    public void testAny() throws SearchParseError {
+    void testAny() throws SearchParseError {
         final SearchCompiler.Match c = SearchCompiler.compile("foo");
         assertTrue(c.match(OsmUtils.createPrimitive("node foobar=true")));
@@ -122,5 +122,5 @@
      */
     @Test
-    public void testEquals() throws SearchParseError {
+    void testEquals() throws SearchParseError {
         final SearchCompiler.Match c = SearchCompiler.compile("foo=bar");
         assertFalse(c.match(OsmUtils.createPrimitive("node foobar=true")));
@@ -136,5 +136,5 @@
      */
     @Test
-    public void testRegexp() throws SearchParseError {
+    void testRegexp() throws SearchParseError {
         final SearchCompiler.Match c = SearchCompiler.compile("foo~[Bb]a[rz]");
         assertFalse(c.match(OsmUtils.createPrimitive("node foobar=true")));
@@ -151,5 +151,5 @@
      */
     @Test
-    public void testCompare() throws SearchParseError {
+    void testCompare() throws SearchParseError {
         final SearchCompiler.Match c1 = SearchCompiler.compile("start_date>1950");
         assertTrue(c1.match(OsmUtils.createPrimitive("node start_date=1950-01-01")));
@@ -191,5 +191,5 @@
      */
     @Test
-    public void testNth() throws SearchParseError {
+    void testNth() throws SearchParseError {
         final DataSet dataSet = new DataSet();
         final Way way = new Way();
@@ -219,5 +219,5 @@
      */
     @Test
-    public void testNthParseNegative() throws SearchParseError {
+    void testNthParseNegative() throws SearchParseError {
         assertEquals("Nth{nth=-1, modulo=false}", SearchCompiler.compile("nth:-1").toString());
     }
@@ -228,10 +228,10 @@
      */
     @Test
-    public void testModified() throws SearchParseError {
+    void testModified() throws SearchParseError {
         SearchContext sc = new SearchContext("modified");
         // Not modified but new
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.w1, sc.r1}) {
-            assertFalse(p.toString(), p.isModified());
-            assertTrue(p.toString(), p.isNewOrUndeleted());
+            assertFalse(p.isModified(), p::toString);
+            assertTrue(p.isNewOrUndeleted(), p::toString);
             sc.match(p, true);
         }
@@ -239,6 +239,6 @@
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.w1, sc.r1}) {
             p.setModified(true);
-            assertTrue(p.toString(), p.isModified());
-            assertTrue(p.toString(), p.isNewOrUndeleted());
+            assertTrue(p.isModified(), p::toString);
+            assertTrue(p.isNewOrUndeleted(), p::toString);
             sc.match(p, true);
         }
@@ -246,6 +246,6 @@
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.w1, sc.r1}) {
             p.setOsmId(1, 1);
-            assertTrue(p.toString(), p.isModified());
-            assertFalse(p.toString(), p.isNewOrUndeleted());
+            assertTrue(p.isModified(), p::toString);
+            assertFalse(p.isNewOrUndeleted(), p::toString);
             sc.match(p, true);
         }
@@ -253,6 +253,6 @@
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n2, sc.w2, sc.r2}) {
             p.setOsmId(2, 2);
-            assertFalse(p.toString(), p.isModified());
-            assertFalse(p.toString(), p.isNewOrUndeleted());
+            assertFalse(p.isModified(), p::toString);
+            assertFalse(p.isNewOrUndeleted(), p::toString);
             sc.match(p, false);
         }
@@ -264,9 +264,9 @@
      */
     @Test
-    public void testSelected() throws SearchParseError {
+    void testSelected() throws SearchParseError {
         SearchContext sc = new SearchContext("selected");
         // Not selected
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.w1, sc.r1}) {
-            assertFalse(p.toString(), p.isSelected());
+            assertFalse(p.isSelected(), p::toString);
             sc.match(p, false);
         }
@@ -274,5 +274,5 @@
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n2, sc.w2, sc.r2}) {
             sc.ds.addSelected(p);
-            assertTrue(p.toString(), p.isSelected());
+            assertTrue(p.isSelected(), p::toString);
             sc.match(p, true);
         }
@@ -284,9 +284,9 @@
      */
     @Test
-    public void testIncomplete() throws SearchParseError {
+    void testIncomplete() throws SearchParseError {
         SearchContext sc = new SearchContext("incomplete");
         // Not incomplete
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.w1, sc.r1}) {
-            assertFalse(p.toString(), p.isIncomplete());
+            assertFalse(p.isIncomplete(), p::toString);
             sc.match(p, false);
         }
@@ -300,5 +300,5 @@
         sc.r2.load(rd);
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n2, sc.w2, sc.r2}) {
-            assertTrue(p.toString(), p.isIncomplete());
+            assertTrue(p.isIncomplete(), p::toString);
             sc.match(p, true);
         }
@@ -310,9 +310,9 @@
      */
     @Test
-    public void testUntagged() throws SearchParseError {
+    void testUntagged() throws SearchParseError {
         SearchContext sc = new SearchContext("untagged");
         // Untagged
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.w1, sc.r1}) {
-            assertFalse(p.toString(), p.isTagged());
+            assertFalse(p.isTagged(), p::toString);
             sc.match(p, true);
         }
@@ -320,5 +320,5 @@
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n2, sc.w2, sc.r2}) {
             p.put("foo", "bar");
-            assertTrue(p.toString(), p.isTagged());
+            assertTrue(p.isTagged(), p::toString);
             sc.match(p, false);
         }
@@ -330,10 +330,10 @@
      */
     @Test
-    public void testClosed() throws SearchParseError {
+    void testClosed() throws SearchParseError {
         SearchContext sc = new SearchContext("closed");
         // Closed
         sc.w1.addNode(sc.n1);
         for (Way w : new Way[]{sc.w1}) {
-            assertTrue(w.toString(), w.isClosed());
+            assertTrue(w.isClosed(), w::toString);
             sc.match(w, true);
         }
@@ -349,9 +349,9 @@
      */
     @Test
-    public void testNew() throws SearchParseError {
+    void testNew() throws SearchParseError {
         SearchContext sc = new SearchContext("new");
         // New
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.w1, sc.r1}) {
-            assertTrue(p.toString(), p.isNew());
+            assertTrue(p.isNew(), p::toString);
             sc.match(p, true);
         }
@@ -359,5 +359,5 @@
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n2, sc.w2, sc.r2}) {
             p.setOsmId(2, 2);
-            assertFalse(p.toString(), p.isNew());
+            assertFalse(p.isNew(), p::toString);
             sc.match(p, false);
         }
@@ -369,5 +369,5 @@
      */
     @Test
-    public void testTypeNode() throws SearchParseError {
+    void testTypeNode() throws SearchParseError {
         final SearchContext sc = new SearchContext("type:node");
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.n2, sc.w1, sc.w2, sc.r1, sc.r2}) {
@@ -381,5 +381,5 @@
      */
     @Test
-    public void testTypeWay() throws SearchParseError {
+    void testTypeWay() throws SearchParseError {
         final SearchContext sc = new SearchContext("type:way");
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.n2, sc.w1, sc.w2, sc.r1, sc.r2}) {
@@ -393,5 +393,5 @@
      */
     @Test
-    public void testTypeRelation() throws SearchParseError {
+    void testTypeRelation() throws SearchParseError {
         final SearchContext sc = new SearchContext("type:relation");
         for (OsmPrimitive p : new OsmPrimitive[]{sc.n1, sc.n2, sc.w1, sc.w2, sc.r1, sc.r2}) {
@@ -405,5 +405,5 @@
      */
     @Test
-    public void testUser() throws SearchParseError {
+    void testUser() throws SearchParseError {
         final SearchContext foobar = new SearchContext("user:foobar");
         foobar.n1.setUser(User.createLocalUser("foobar"));
@@ -421,5 +421,5 @@
      */
     @Test
-    public void testFooTypeBar() throws SearchParseError {
+    void testFooTypeBar() throws SearchParseError {
         Exception e = assertThrows(SearchParseError.class, () -> SearchCompiler.compile("foo type bar"));
         assertEquals("<html>Expecting <code>:</code> after <i>type</i></html>", e.getMessage());
@@ -431,5 +431,5 @@
      */
     @Test
-    public void testTimestamp() throws SearchParseError {
+    void testTimestamp() throws SearchParseError {
         final Node n1 = new Node();
         n1.setTimestamp(DateUtils.fromString("2010-01-22"));
@@ -448,5 +448,5 @@
      */
     @Test
-    public void testBooleanLogic() throws SearchParseError {
+    void testBooleanLogic() throws SearchParseError {
         final SearchCompiler.Match c1 = SearchCompiler.compile("foo AND bar AND baz");
         assertTrue(c1.match(OsmUtils.createPrimitive("node foobar=baz")));
@@ -471,5 +471,5 @@
      */
     @Test
-    public void testBuildSearchStringForTag() throws SearchParseError {
+    void testBuildSearchStringForTag() throws SearchParseError {
         final Tag tag1 = new Tag("foo=", "bar\"");
         final Tag tag2 = new Tag("foo=", "=bar");
@@ -486,13 +486,12 @@
     /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/13870">Bug #13870</a>.
-     * @throws SearchParseError always
-     */
-    @Test(expected = SearchParseError.class)
-    public void testPattern13870() throws SearchParseError {
+     */
+    @Test
+    void testPattern13870() {
         // https://bugs.openjdk.java.net/browse/JI-9044959
         SearchSetting setting = new SearchSetting();
         setting.regexSearch = true;
         setting.text = "[";
-        SearchCompiler.compile(setting);
+        assertThrows(SearchParseError.class, () -> SearchCompiler.compile(setting));
     }
 
@@ -502,5 +501,5 @@
      */
     @Test
-    public void testTicket14217() throws Exception {
+    void testTicket14217() throws Exception {
         assertNotNull(SearchCompiler.compile(new String(Files.readAllBytes(
                 Paths.get(TestUtils.getRegressionDataFile(14217, "filter.txt"))), StandardCharsets.UTF_8)));
@@ -509,12 +508,11 @@
     /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17112">Bug #17112</a>.
-     * @throws SearchParseError always
-     */
-    @Test(expected = SearchParseError.class)
-    public void testTicket17112() throws SearchParseError {
+     */
+    @Test
+    void testTicket17112() {
         SearchSetting setting = new SearchSetting();
         setting.mapCSSSearch = true;
         setting.text = "w"; // partial input
-        SearchCompiler.compile(setting);
+        assertThrows(SearchParseError.class, () -> SearchCompiler.compile(setting));
     }
 
@@ -524,5 +522,5 @@
      */
     @Test
-    public void testEmptyValues15943() throws SearchParseError {
+    void testEmptyValues15943() throws SearchParseError {
         Match matcher = SearchCompiler.compile("access=");
         assertTrue(matcher.match(new Tag("access", null)));
@@ -536,5 +534,5 @@
      */
     @Test
-    public void testKeyExists15943() throws SearchParseError {
+    void testKeyExists15943() throws SearchParseError {
         Match matcher = SearchCompiler.compile("surface:");
         assertTrue(matcher.match(new Tag("surface", "")));
@@ -549,5 +547,5 @@
      */
     @Test
-    public void testEnumExactKeyValueMode() {
+    void testEnumExactKeyValueMode() {
         assertDoesNotThrow(() -> TestUtils.superficialEnumCodeCoverage(ExactKeyValue.Mode.class));
     }
@@ -555,9 +553,8 @@
     /**
      * Robustness test for preset searching. Ensures that the query 'preset:' is not accepted.
-     * @throws SearchParseError always
      * @since 12464
      */
-    @Test(expected = SearchParseError.class)
-    public void testPresetSearchMissingValue() throws SearchParseError {
+    @Test
+    void testPresetSearchMissingValue() {
         SearchSetting settings = new SearchSetting();
         settings.text = "preset:";
@@ -566,5 +563,5 @@
         TaggingPresets.readFromPreferences();
 
-        SearchCompiler.compile(settings);
+        assertThrows(SearchParseError.class, () -> SearchCompiler.compile(settings));
     }
 
@@ -572,9 +569,8 @@
      * Robustness test for preset searching. Validates that it is not possible to search for
      * non existing presets.
-     * @throws SearchParseError always
      * @since 12464
      */
-    @Test(expected = SearchParseError.class)
-    public void testPresetNotExist() throws SearchParseError {
+    @Test
+    void testPresetNotExist() {
         String testPresetName = "groupnamethatshouldnotexist/namethatshouldnotexist";
         SearchSetting settings = new SearchSetting();
@@ -585,5 +581,5 @@
         TaggingPresets.readFromPreferences();
 
-        SearchCompiler.compile(settings);
+        assertThrows(SearchParseError.class, () -> SearchCompiler.compile(settings));
     }
 
@@ -591,9 +587,8 @@
      * Robustness tests for preset searching. Ensures that combined preset names (having more than
      * 1 word) must be enclosed with " .
-     * @throws SearchParseError always
      * @since 12464
      */
-    @Test(expected = SearchParseError.class)
-    public void testPresetMultipleWords() throws SearchParseError {
+    @Test
+    void testPresetMultipleWords() {
         TaggingPreset testPreset = new TaggingPreset();
         testPreset.name = "Test Combined Preset Name";
@@ -609,5 +604,5 @@
         TaggingPresets.readFromPreferences();
 
-        SearchCompiler.compile(settings);
+        assertThrows(IllegalArgumentException.class, () -> SearchCompiler.compile(settings));
     }
 
@@ -621,5 +616,5 @@
      */
     @Test
-    public void testPresetLookup() throws SearchParseError, NoSuchFieldException, IllegalAccessException {
+    void testPresetLookup() throws SearchParseError, NoSuchFieldException, IllegalAccessException {
         TaggingPreset testPreset = new TaggingPreset();
         testPreset.name = "Test Preset Name";
@@ -660,5 +655,5 @@
      */
     @Test
-    public void testPresetLookupWildcard() throws SearchParseError, NoSuchFieldException, IllegalAccessException {
+    void testPresetLookupWildcard() throws SearchParseError, NoSuchFieldException, IllegalAccessException {
         TaggingPresetMenu group = new TaggingPresetMenu();
         group.name = "TestPresetGroup";
@@ -705,5 +700,5 @@
      */
     @Test
-    public void testPreset() throws SearchParseError {
+    void testPreset() throws SearchParseError {
         final String presetName = "Test Preset Name";
         final String presetGroupName = "Test Preset Group";
@@ -744,5 +739,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         Set<Class<? extends Match>> matchers = TestUtils.getJosmSubtypes(Match.class);
@@ -768,5 +763,5 @@
      */
     @Test
-    public void testNodeCount() throws SearchParseError {
+    void testNodeCount() throws SearchParseError {
         final SearchContext sc = new SearchContext("nodes:2");
         sc.match(sc.n1, false);
@@ -784,5 +779,5 @@
      */
     @Test
-    public void testWayCount() throws SearchParseError {
+    void testWayCount() throws SearchParseError {
         final SearchContext sc = new SearchContext("ways:2");
         sc.match(sc.n1, true);
@@ -800,5 +795,5 @@
      */
     @Test
-    public void testMemberCount() throws SearchParseError {
+    void testMemberCount() throws SearchParseError {
         final SearchContext sc = new SearchContext("members:2");
         sc.match(sc.n1, false);
@@ -814,5 +809,5 @@
      */
     @Test
-    public void testRole() throws SearchParseError {
+    void testRole() throws SearchParseError {
         final SearchContext sc = new SearchContext("role:foo");
         sc.match(sc.r1, false);
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchModeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchModeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchModeTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.osm.search;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -12,10 +12,10 @@
  * Unit tests for class {@link SearchMode}.
  */
-public class SearchModeTest {
+class SearchModeTest {
 
     /**
      * Setup rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testEnumSearchMode() {
+    void testEnumSearchMode() {
         TestUtils.superficialEnumCodeCoverage(SearchMode.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.data.osm.visitor;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+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.assertTrue;
 
 import java.util.Collection;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -26,5 +26,5 @@
  * Unit tests for class {@link MergeSourceBuildingVisitor}.
  */
-public class MergeSourceBuildingVisitorTest {
+class MergeSourceBuildingVisitorTest {
 
     protected OsmPrimitive lookupByName(Collection<? extends OsmPrimitive> primitives, String name) {
@@ -39,10 +39,10 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
 
     @Test
-    public void testNodes() {
+    void testNodes() {
         DataSet source = new DataSet();
         Node n1 = new Node(1);
@@ -78,5 +78,5 @@
 
     @Test
-    public void testOneWay() {
+    void testOneWay() {
         DataSet source = new DataSet();
         Node n1 = new Node(1);
@@ -110,5 +110,5 @@
 
     @Test
-    public void testOneWayNodesSelectedToo() {
+    void testOneWayNodesSelectedToo() {
         DataSet source = new DataSet();
         Node n1 = new Node(1);
@@ -142,5 +142,5 @@
 
     @Test
-    public void testOneWayIncomplete() {
+    void testOneWayIncomplete() {
         DataSet source = new DataSet();
         Way w1 = new Way(3);
@@ -160,5 +160,5 @@
 
     @Test
-    public void testOneRelationExistingMembersSelected() {
+    void testOneRelationExistingMembersSelected() {
         DataSet source = new DataSet();
         Relation r1 = new Relation(1, 1);
@@ -219,5 +219,5 @@
 
     @Test
-    public void testOneRelationExistingMembersNotSelected() {
+    void testOneRelationExistingMembersNotSelected() {
         DataSet source = new DataSet();
         Relation r1 = new Relation(1, 1);
@@ -278,5 +278,5 @@
 
     @Test
-    public void testOneRelationNewMembersNotSelected() {
+    void testOneRelationNewMembersNotSelected() {
         DataSet source = new DataSet();
         Relation r1 = new Relation();
@@ -345,5 +345,5 @@
 
     @Test
-    public void testOneRelationExistingRecursive() {
+    void testOneRelationExistingRecursive() {
         DataSet source = new DataSet();
         Relation r1 = new Relation(1, 1);
@@ -364,5 +364,5 @@
 
     @Test
-    public void testOneRelationNewRecursive() {
+    void testOneRelationNewRecursive() {
         DataSet source = new DataSet();
         Relation r1 = new Relation();
@@ -384,5 +384,5 @@
 
     @Test
-    public void testTwoRelationExistingCircular() {
+    void testTwoRelationExistingCircular() {
         DataSet source = new DataSet();
         Relation r1 = new Relation(1, 1);
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.osm.visitor.paint;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.StyleRecord;
@@ -17,5 +17,5 @@
  * @since 12078
  */
-public class StyledMapRendererTest {
+class StyledMapRendererTest {
 
     /**
@@ -23,5 +23,5 @@
      */
     @Test
-    public void testFloatToFixed() {
+    void testFloatToFixed() {
         long inf = floatToFixedCheckBits(Float.POSITIVE_INFINITY, 24);
         long big = floatToFixedCheckBits(Float.MAX_VALUE, 24);
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(StyleRecord.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/preferences/JosmUrlsTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.preferences;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -14,10 +14,10 @@
  * Unit tests of {@link JosmUrls} class.
  */
-public class JosmUrlsTest {
+class JosmUrlsTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().devAPI();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testGetBaseUserUrl() {
+    void testGetBaseUserUrl() {
         assertEquals("https://api06.dev.openstreetmap.org/user", Config.getUrls().getBaseUserUrl());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.preferences;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.Color;
@@ -11,7 +11,7 @@
 import javax.swing.UIManager;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.spi.preferences.Config;
@@ -24,9 +24,9 @@
  * @author Michael Zangl
  */
-public class NamedColorPropertyTest {
+class NamedColorPropertyTest {
     /**
      * This is a preference test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -36,5 +36,5 @@
      * Set up test case
      */
-    @Before
+    @BeforeEach
     public void createTestProperty() {
         base = new NamedColorProperty("test", Color.RED);
@@ -45,5 +45,5 @@
      */
     @Test
-    public void testGet() {
+    void testGet() {
         assertEquals(Color.RED, base.get());
 
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testPut() {
+    void testPut() {
         assertEquals(Color.RED, base.get());
 
@@ -80,5 +80,5 @@
      */
     @Test
-    public void testColorAlpha() {
+    void testColorAlpha() {
         assertEquals(0x12, new NamedColorProperty("foo", new Color(0x12345678, true)).get().getAlpha());
         assertTrue(Preferences.main().putList("clr.general.bar", Arrays.asList("#34567812", "general", "", "bar")));
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testColorNameAlpha() {
+    void testColorNameAlpha() {
         assertEquals(0x12, new NamedColorProperty("foo", new Color(0x12345678, true)).get().getAlpha());
     }
@@ -98,5 +98,5 @@
      */
     @Test
-    public void testGetChildColor() {
+    void testGetChildColor() {
         AbstractProperty<Color> child = base.getChildColor("test2");
 
Index: trunk/test/unit/org/openstreetmap/josm/data/preferences/PreferencesWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/preferences/PreferencesWriterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/preferences/PreferencesWriterTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.data.preferences;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.IOException;
@@ -13,5 +13,5 @@
 import java.util.TreeMap;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.spi.preferences.Setting;
@@ -25,5 +25,5 @@
  * Unit tests for class {@link PreferencesWriter}.
  */
-public class PreferencesWriterTest {
+class PreferencesWriterTest {
 
     private static <T extends AbstractSetting<?>> T setting(T s, long time) {
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testListList() throws IOException {
+    void testListList() throws IOException {
         try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) {
             long time = System.currentTimeMillis() / 1000;
@@ -56,5 +56,5 @@
      */
     @Test
-    public void testList() throws IOException {
+    void testList() throws IOException {
         try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) {
             long time = System.currentTimeMillis() / 1000;
@@ -73,5 +73,5 @@
      */
     @Test
-    public void testMapList() throws IOException {
+    void testMapList() throws IOException {
         try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) {
             long time = System.currentTimeMillis() / 1000;
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testString() throws IOException {
+    void testString() throws IOException {
         try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) {
             long time = System.currentTimeMillis() / 1000;
@@ -109,5 +109,5 @@
      */
     @Test
-    public void testWrite() throws IOException {
+    void testWrite() throws IOException {
         try (StringWriter out = new StringWriter(); PreferencesWriter w = new PreferencesWriter(new PrintWriter(out), true, true)) {
             long time = System.currentTimeMillis() / 1000;
@@ -132,5 +132,5 @@
      */
     @Test
-    public void testNullValue() throws IOException {
+    void testNullValue() throws IOException {
         long time = System.currentTimeMillis() / 1000;
         // CHECKSTYLE.OFF: LineLength
Index: trunk/test/unit/org/openstreetmap/josm/data/preferences/StrokePropertyTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/preferences/StrokePropertyTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/preferences/StrokePropertyTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.preferences;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.awt.BasicStroke;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -18,9 +18,9 @@
  * @author Michael Zangl
  */
-public class StrokePropertyTest {
+class StrokePropertyTest {
     /**
      * This is a preference test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testGetValue() {
+    void testGetValue() {
         StrokeProperty property = new StrokeProperty("x", "1");
 
@@ -75,5 +75,5 @@
      */
     @Test
-    public void testPutValue() {
+    void testPutValue() {
         StrokeProperty property = new StrokeProperty("x", new BasicStroke(12));
         BasicStroke bs = property.get();
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/CustomProjectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/CustomProjectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/CustomProjectionTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.data.projection;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.stream.Stream;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.projection.CustomProjection.Polarity;
@@ -20,9 +20,9 @@
  * @author Michael Zangl
  */
-public class CustomProjectionTest {
+class CustomProjectionTest {
     /**
      * Need pref to load pref.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testParseAngle() throws ProjectionConfigurationException {
+    void testParseAngle() throws ProjectionConfigurationException {
         assertEquals(0, CustomProjection.parseAngle("0", "xxx"), 1e-10);
         assertEquals(1, CustomProjection.parseAngle("1", "xxx"), 1e-10);
@@ -86,5 +86,5 @@
      */
     @Test
-    public void testPolarity() {
+    void testPolarity() {
         assertEquals(LatLon.NORTH_POLE, Polarity.NORTH.getLatLon());
         assertEquals(LatLon.SOUTH_POLE, Polarity.SOUTH.getLatLon());
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java	(revision 17275)
@@ -6,5 +6,5 @@
 
 import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 
@@ -12,5 +12,5 @@
  * Unit tests for class {@link Ellipsoid}.
  */
-public class EllipsoidTest {
+class EllipsoidTest {
 
     private static final double EPSILON = 1e-8;
@@ -20,5 +20,5 @@
      */
     @Test
-    public void testLatLon2Cart2LatLon() {
+    void testLatLon2Cart2LatLon() {
         Random r = new SecureRandom();
         double maxErrLat = 0, maxErrLon = 0;
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 17275)
@@ -34,6 +34,6 @@
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -59,5 +59,5 @@
  * of the algorithm, given a certain definition.
  */
-public class ProjectionRefTest {
+class ProjectionRefTest {
 
     private static final String CS2CS_EXE = "cs2cs";
@@ -86,5 +86,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projectionNadGrids().timeout(90_000);
@@ -373,5 +373,5 @@
      */
     @Test
-    public void testProjections() throws IOException {
+    void testProjections() throws IOException {
         StringBuilder fail = new StringBuilder();
         Map<String, Set<String>> failingProjs = new HashMap<>();
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 17275)
@@ -19,6 +19,6 @@
 import java.util.stream.Collectors;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.Bounds;
@@ -39,5 +39,5 @@
  * test data, by running the main method of this class and commit the new data file.
  */
-public class ProjectionRegressionTest {
+class ProjectionRegressionTest {
 
     private static final String PROJECTION_DATA_FILE = "nodist/data/projection/projection-regression-test-data";
@@ -136,5 +136,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -146,5 +146,5 @@
      */
     @Test
-    public void testNonRegression() throws IOException {
+    void testNonRegression() throws IOException {
         List<TestData> allData = readData();
         Set<String> dataCodes = allData.stream().map(data -> data.code).collect(Collectors.toSet());
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.data.projection;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.security.SecureRandom;
@@ -11,5 +11,5 @@
 
 import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -19,5 +19,5 @@
  * Unit tests for class {@link Projection}.
  */
-public class ProjectionTest {
+class ProjectionTest {
 
     private static final Random rand = new SecureRandom();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testProjections() {
+    void testProjections() {
         error = false;
         text = "";
@@ -120,5 +120,5 @@
      */
     @Test
-    public void testProjs() {
+    void testProjs() {
         error2 = false;
         text2 = "";
@@ -150,5 +150,5 @@
             Assert.fail();
         }
-        assertTrue("missing test: "+projIds, projIds.isEmpty());
+        assertTrue(projIds.isEmpty(), "missing test: "+projIds);
     }
 
@@ -170,5 +170,5 @@
             EastNorth en = p.latlon2eastNorth(ll1);
             LatLon ll2 = p.eastNorth2latlon(en);
-            assertTrue(p.toCode() + " at " + ll1 + " is " + ll2, ll2.isValid());
+            assertTrue(ll2.isValid(), p.toCode() + " at " + ll1 + " is " + ll2);
             double dist = ll1.greatCircleDistance(ll2);
             if (dist > eps) {
@@ -189,5 +189,5 @@
      */
     @Test
-    public void testSwedishProjections() {
+    void testSwedishProjections() {
         for (int code = 3006; code <= 3018; code++) {
             assertTrue(Projections.getProjectionByCode("EPSG:"+code).switchXY());
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/ShiftedProjectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/ShiftedProjectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/ShiftedProjectionTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.data.projection;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Comparator;
@@ -11,5 +11,5 @@
 import java.util.stream.Collectors;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.ProjectionBounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -21,5 +21,5 @@
  * @author Michael Zangl
  */
-public class ShiftedProjectionTest {
+class ShiftedProjectionTest {
     private static final class ProjectingBase implements Projecting {
         @Override
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testLatlon2eastNorth() {
+    void testLatlon2eastNorth() {
         Projecting base = new ProjectingBase();
 
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testEastNorth2latlonClamped() {
+    void testEastNorth2latlonClamped() {
         Projecting base = new ProjectingBase();
 
@@ -105,5 +105,5 @@
      */
     @Test
-    public void testGetProjectingsForArea() {
+    void testGetProjectingsForArea() {
         Projecting base = new ProjectingBase();
         ShiftedProjecting shifted = new ShiftedProjecting(base, new EastNorth(5, 7));
@@ -124,5 +124,5 @@
      */
     @Test
-    public void testGetProjectingsForAreaMultiple() {
+    void testGetProjectingsForAreaMultiple() {
         Projecting base = new ProjectingBase();
         ShiftedProjecting shifted = new ShiftedProjecting(base, new EastNorth(5, 7));
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.projection;
 
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+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;
@@ -17,5 +17,5 @@
  * Unit tests for the Swiss projection grid.
  */
-public class SwissGridTest {
+class SwissGridTest {
     private static final String SWISS_EPSG_CODE = "EPSG:21781";
     private final boolean debug = false;
@@ -24,5 +24,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projectionNadGrids();
@@ -31,5 +31,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         ProjectionRegistry.setProjection(Projections.getProjectionByCode(SWISS_EPSG_CODE)); // Swiss grid
@@ -79,5 +79,5 @@
             }
         }
-        assertSame(errs.toString(), errs.length(), 0);
+        assertSame(errs.length(), 0, errs::toString);
     }
 
@@ -86,5 +86,5 @@
      */
     @Test
-    public void testProjReferenceTestAccurate() {
+    void testProjReferenceTestAccurate() {
         projReferenceTest(EPSILON_ACCURATE);
     }
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testAlatlon2eastNorth() {
+    void testAlatlon2eastNorth() {
         LatLon ll = new LatLon(46.518, 6.567);
         EastNorth en = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
@@ -100,6 +100,6 @@
             System.out.println(en);
         }
-        assertTrue("Lausanne", Math.abs(en.east() - 533112.13) < 0.1);
-        assertTrue("Lausanne", Math.abs(en.north() - 152227.35) < 0.1);
+        assertTrue(Math.abs(en.east() - 533112.13) < 0.1, "Lausanne");
+        assertTrue(Math.abs(en.north() - 152227.35) < 0.1, "Lausanne");
 
         ll = new LatLon(47.78, 8.58);
@@ -108,6 +108,6 @@
             System.out.println(en);
         }
-        assertTrue("Schafouse", Math.abs(en.east() - 685542.97) < 0.1);
-        assertTrue("Schafouse", Math.abs(en.north() - 292783.21) < 0.1);
+        assertTrue(Math.abs(en.east() - 685542.97) < 0.1, "Schafouse");
+        assertTrue(Math.abs(en.north() - 292783.21) < 0.1, "Schafouse");
 
         ll = new LatLon(46.58, 10.48);
@@ -116,6 +116,6 @@
             System.out.println(en);
         }
-        assertTrue("Grinson", Math.abs(en.east() - 833066.95) < 0.1);
-        assertTrue("Grinson", Math.abs(en.north() - 163265.32) < 0.1);
+        assertTrue(Math.abs(en.east() - 833066.95) < 0.1, "Grinson");
+        assertTrue(Math.abs(en.north() - 163265.32) < 0.1, "Grinson");
 
         ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600);
@@ -124,6 +124,6 @@
             System.out.println(en);
         }
-        assertTrue("Berne", Math.abs(en.east() - 600000.0) < 0.1);
-        assertTrue("Berne", Math.abs(en.north() - 200000.0) < 0.1);
+        assertTrue(Math.abs(en.east() - 600000.0) < 0.1, "Berne");
+        assertTrue(Math.abs(en.north() - 200000.0) < 0.1, "Berne");
 
         // http://geodesy.geo.admin.ch/reframe/lv03towgs84?easting=700000&northing=100000
@@ -133,6 +133,6 @@
             System.out.println(en);
         }
-        assertTrue("Ref", Math.abs(en.east() - 700000.0) < 0.1);
-        assertTrue("Ref", Math.abs(en.north() - 100000.0) < 0.1);
+        assertTrue(Math.abs(en.east() - 700000.0) < 0.1, "Ref");
+        assertTrue(Math.abs(en.north() - 100000.0) < 0.1, "Ref");
     }
 
@@ -141,5 +141,5 @@
      */
     @Test
-    public void testBeastNorth2latlon() {
+    void testBeastNorth2latlon() {
         EastNorth en = new EastNorth(533112.13, 152227.35);
         LatLon ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
@@ -147,6 +147,6 @@
             System.out.println(ll);
         }
-        assertTrue("Lausanne", Math.abs(ll.lat() - 46.518) < 0.00001);
-        assertTrue("Lausanne", Math.abs(ll.lon() - 6.567) < 0.00001);
+        assertTrue(Math.abs(ll.lat() - 46.518) < 0.00001, "Lausanne");
+        assertTrue(Math.abs(ll.lon() - 6.567) < 0.00001, "Lausanne");
 
         en = new EastNorth(685542.97, 292783.21);
@@ -155,6 +155,6 @@
             System.out.println(ll);
         }
-        assertTrue("Schafouse", Math.abs(ll.lat() - 47.78) < 0.00001);
-        assertTrue("Schafouse", Math.abs(ll.lon() - 8.58) < 0.00001);
+        assertTrue(Math.abs(ll.lat() - 47.78) < 0.00001, "Schafouse");
+        assertTrue(Math.abs(ll.lon() - 8.58) < 0.00001, "Schafouse");
 
         en = new EastNorth(833066.95, 163265.32);
@@ -163,6 +163,6 @@
             System.out.println(ll);
         }
-        assertTrue("Grinson", Math.abs(ll.lat() - 46.58) < 0.00001);
-        assertTrue("Grinson", Math.abs(ll.lon() - 10.48) < 0.00001);
+        assertTrue(Math.abs(ll.lat() - 46.58) < 0.00001, "Grinson");
+        assertTrue(Math.abs(ll.lon() - 10.48) < 0.00001, "Grinson");
 
         en = new EastNorth(600000.0, 200000.0);
@@ -171,6 +171,6 @@
             System.out.println(ll);
         }
-        assertTrue("Berne", Math.abs(ll.lat() - (46.0 + 57.0 / 60 + 3.89813884505 / 3600)) < 0.00001);
-        assertTrue("Berne", Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001);
+        assertTrue(Math.abs(ll.lat() - (46.0 + 57.0 / 60 + 3.89813884505 / 3600)) < 0.00001, "Berne");
+        assertTrue(Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001, "Berne");
 
         // http://geodesy.geo.admin.ch/reframe/lv03towgs84?easting=700000&northing=100000
@@ -180,6 +180,6 @@
             System.out.println(ll);
         }
-        assertTrue("Ref", Math.abs(ll.lat() - 46.04412093223244) < 0.00001);
-        assertTrue("Ref", Math.abs(ll.lon() - 8.730497366167727) < 0.00001);
+        assertTrue(Math.abs(ll.lat() - 46.04412093223244) < 0.00001, "Ref");
+        assertTrue(Math.abs(ll.lon() - 8.730497366167727) < 0.00001, "Ref");
     }
 
@@ -188,5 +188,5 @@
      */
     @Test
-    public void testCsendandreturn() {
+    void testCsendandreturn() {
         EastNorth en = new EastNorth(533111.69, 152227.85);
         LatLon ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
@@ -198,6 +198,6 @@
             System.out.println(en.north() - en2.north());
         }
-        assertTrue("Lausanne", Math.abs(en.east() - en2.east()) < 0.002);
-        assertTrue("Lausanne", Math.abs(en.north() - en2.north()) < 0.002);
+        assertTrue(Math.abs(en.east() - en2.east()) < 0.002, "Lausanne");
+        assertTrue(Math.abs(en.north() - en2.north()) < 0.002, "Lausanne");
 
         en = new EastNorth(685544.16, 292782.91);
@@ -210,6 +210,6 @@
             System.out.println(en.north() - en2.north());
         }
-        assertTrue("Schafouse", Math.abs(en.east() - en2.east()) < 0.002);
-        assertTrue("Schafouse", Math.abs(en.north() - en2.north()) < 0.002);
+        assertTrue(Math.abs(en.east() - en2.east()) < 0.002, "Schafouse");
+        assertTrue(Math.abs(en.north() - en2.north()) < 0.002, "Schafouse");
 
         en = new EastNorth(833068.04, 163265.39);
@@ -222,6 +222,6 @@
             System.out.println(en.north() - en2.north());
         }
-        assertTrue("Grinson", Math.abs(en.east() - en2.east()) < 0.002);
-        assertTrue("Grinson", Math.abs(en.north() - en2.north()) < 0.002);
+        assertTrue(Math.abs(en.east() - en2.east()) < 0.002, "Grinson");
+        assertTrue(Math.abs(en.north() - en2.north()) < 0.002, "Grinson");
 
         en = new EastNorth(600000.0, 200000.0);
@@ -234,6 +234,6 @@
             System.out.println(en.north() - en2.north());
         }
-        assertTrue("Berne", Math.abs(en.east() - en2.east()) < 0.002);
-        assertTrue("Berne", Math.abs(en.north() - en2.north()) < 0.002);
+        assertTrue(Math.abs(en.east() - en2.east()) < 0.002, "Berne");
+        assertTrue(Math.abs(en.north() - en2.north()) < 0.002, "Berne");
 
         en = new EastNorth(700000.0, 100000.0);
@@ -246,6 +246,6 @@
             System.out.println(en.north() - en2.north());
         }
-        assertTrue("Ref", Math.abs(en.east() - en2.east()) < 0.002);
-        assertTrue("Ref", Math.abs(en.north() - en2.north()) < 0.002);
+        assertTrue(Math.abs(en.east() - en2.east()) < 0.002, "Ref");
+        assertTrue(Math.abs(en.north() - en2.north()) < 0.002, "Ref");
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/proj/LonLatTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/proj/LonLatTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/proj/LonLatTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.projection.proj;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,9 +13,9 @@
  * Tests for {@link LonLat}.
  */
-public class LonLatTest {
+class LonLatTest {
     /**
      * Setup rule.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testLonIsLinearToEast() {
+    void testLonIsLinearToEast() {
         assertFalse(new LonLat().lonIsLinearToEast());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/proj/MercatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/proj/MercatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/proj/MercatorTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.projection.proj;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,9 +13,9 @@
  * Tests for {@link Mercator}.
  */
-public class MercatorTest {
+class MercatorTest {
     /**
      * Setup rule.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testLonIsLinearToEast() {
+    void testLonIsLinearToEast() {
         assertTrue(new Mercator().lonIsLinearToEast());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/tagging/ac/AutoCompletionPriorityTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/tagging/ac/AutoCompletionPriorityTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/tagging/ac/AutoCompletionPriorityTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.tagging.ac;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
@@ -12,6 +12,6 @@
 import java.util.TreeSet;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -23,10 +23,10 @@
  * Unit tests of {@link AutoCompletionPriority}.
  */
-public class AutoCompletionPriorityTest {
+class AutoCompletionPriorityTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testGetters() {
+    void testGetters() {
         assertTrue(AutoCompletionPriority.IS_IN_STANDARD_AND_IN_DATASET.isInStandard());
         assertTrue(AutoCompletionPriority.IS_IN_STANDARD_AND_IN_DATASET.isInDataSet());
@@ -69,5 +69,5 @@
      */
     @Test
-    public void testOrdering() {
+    void testOrdering() {
         SortedSet<AutoCompletionPriority> set = new TreeSet<>();
         set.add(AutoCompletionPriority.IS_IN_STANDARD_AND_IN_DATASET);
@@ -96,5 +96,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(AutoCompletionPriority.class).usingGetClass()
@@ -106,5 +106,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("<Priority; userInput: no, inDataSet: true, inStandard: false, selected: false>",
                 AutoCompletionPriority.IS_IN_DATASET.toString());
@@ -117,5 +117,5 @@
      */
     @Test
-    public void testMergeWith() {
+    void testMergeWith() {
         assertEquals(AutoCompletionPriority.IS_IN_STANDARD_AND_IN_DATASET,
                 AutoCompletionPriority.IS_IN_DATASET.mergeWith(AutoCompletionPriority.IS_IN_STANDARD));
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.validation;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -18,10 +18,10 @@
  * Unit tests for class {@link OsmValidator}.
  */
-public class OsmValidatorTest {
+class OsmValidatorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -31,5 +31,5 @@
      * @throws Exception if an error occurs
      */
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         OsmValidator.clearIgnoredErrors();
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(OsmValidator.class);
     }
@@ -49,5 +49,5 @@
      */
     @Test
-    public void testCleanupIgnoredErrors1() {
+    void testCleanupIgnoredErrors1() {
         OsmValidator.addIgnoredError("1351:n_2449148994:w_236955234", "Way end node near other way");
         OsmValidator.addIgnoredError("1351:n_6871910559:w_733713588", "Way end node near other way");
@@ -64,5 +64,5 @@
      */
     @Test
-    public void testCleanupIgnoredErrorsTicket17837() {
+    void testCleanupIgnoredErrorsTicket17837() {
         OsmValidator.addIgnoredError("120");
         OsmValidator.addIgnoredError("3000");
@@ -77,5 +77,5 @@
      */
     @Test
-    public void testCleanupIgnoredErrorsTicket18223() {
+    void testCleanupIgnoredErrorsTicket18223() {
         OsmValidator.addIgnoredError("1351:n_2449148994:w_236955234", "Way end node near other way");
         OsmValidator.addIgnoredError("1351:n_6871910559:w_733713588", "Way end node near other way");
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testRemoveTests() {
+    void testRemoveTests() {
         org.openstreetmap.josm.data.validation.Test test = new org.openstreetmap.josm.data.validation.Test("test") {
         };
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTest.java	(revision 17275)
@@ -22,5 +22,5 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.lang.reflect.Field;
@@ -28,6 +28,6 @@
 import java.util.Locale;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.validation.routines.DomainValidator.ArrayType;
 import org.openstreetmap.josm.tools.Logging;
@@ -38,5 +38,5 @@
  * @version $Revision: 1741724 $
  */
-public class DomainValidatorTest {
+class DomainValidatorTest {
 
     private DomainValidator validator;
@@ -45,5 +45,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         validator = DomainValidator.getInstance();
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testValidDomains() {
+    void testValidDomains() {
         assertTrue("apache.org should validate", validator.isValid("apache.org"));
         assertTrue("www.google.com should validate", validator.isValid("www.google.com"));
@@ -75,5 +75,5 @@
      */
     @Test
-    public void testInvalidDomains() {
+    void testInvalidDomains() {
         assertFalse("bare TLD .org shouldn't validate", validator.isValid(".org"));
         assertFalse("domain name with spaces shouldn't validate", validator.isValid(" apache.org "));
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testTopLevelDomains() {
+    void testTopLevelDomains() {
         // infrastructure TLDs
         assertTrue(".arpa should validate as iTLD", validator.isValidInfrastructureTld(".arpa"));
@@ -121,5 +121,5 @@
      */
     @Test
-    public void testAllowLocal() {
+    void testAllowLocal() {
        DomainValidator noLocal = DomainValidator.getInstance(false);
        DomainValidator allowLocal = DomainValidator.getInstance(true);
@@ -147,5 +147,5 @@
      */
     @Test
-    public void testIDN() {
+    void testIDN() {
        assertTrue("b\u00fccher.ch in IDN should validate", validator.isValid("www.xn--bcher-kva.ch"));
     }
@@ -155,5 +155,5 @@
      */
     @Test
-    public void testIDNJava6OrLater() {
+    void testIDNJava6OrLater() {
         String version = System.getProperty("java.version");
         if (version.compareTo("1.6") < 0) {
@@ -171,5 +171,5 @@
      */
     @Test
-    public void testRFC2396domainlabel() { // use fixed valid TLD
+    void testRFC2396domainlabel() { // use fixed valid TLD
         assertTrue("a.ch should validate", validator.isValid("a.ch"));
         assertTrue("9.ch should validate", validator.isValid("9.ch"));
@@ -185,5 +185,5 @@
      */
     @Test
-    public void testRFC2396toplabel() {
+    void testRFC2396toplabel() {
         // These tests use non-existent TLDs so currently need to use a package protected method
         assertTrue("a.c (alpha) should validate", validator.isValidDomainSyntax("a.c"));
@@ -203,5 +203,5 @@
      */
     @Test
-    public void testDomainNoDots() {
+    void testDomainNoDots() {
         assertTrue("a (alpha) should validate", validator.isValidDomainSyntax("a"));
         assertTrue("9 (alphanum) should validate", validator.isValidDomainSyntax("9"));
@@ -217,5 +217,5 @@
      */
     @Test
-    public void testValidator297() {
+    void testValidator297() {
         assertTrue("xn--d1abbgf6aiiy.xn--p1ai should validate", validator.isValid("xn--d1abbgf6aiiy.xn--p1ai")); // This uses a valid TLD
      }
@@ -226,5 +226,5 @@
      */
     @Test
-    public void testValidator306() {
+    void testValidator306() {
         final String longString = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789A";
         assertEquals(63, longString.length()); // 26 * 2 + 11
@@ -251,5 +251,5 @@
      */
     @Test
-    public void testUnicodeToASCII() {
+    void testUnicodeToASCII() {
         String[] asciidots = {
                 "",
@@ -289,5 +289,5 @@
      */
     @Test
-    public void test_INFRASTRUCTURE_TLDS_sortedAndLowerCase() throws Exception {
+    void test_INFRASTRUCTURE_TLDS_sortedAndLowerCase() throws Exception {
         final boolean sorted = isSortedLowerCase("INFRASTRUCTURE_TLDS");
         assertTrue(sorted);
@@ -299,5 +299,5 @@
      */
     @Test
-    public void test_COUNTRY_CODE_TLDS_sortedAndLowerCase() throws Exception {
+    void test_COUNTRY_CODE_TLDS_sortedAndLowerCase() throws Exception {
         final boolean sorted = isSortedLowerCase("COUNTRY_CODE_TLDS");
         assertTrue(sorted);
@@ -309,5 +309,5 @@
      */
     @Test
-    public void test_GENERIC_TLDS_sortedAndLowerCase() throws Exception {
+    void test_GENERIC_TLDS_sortedAndLowerCase() throws Exception {
         final boolean sorted = isSortedLowerCase("GENERIC_TLDS");
         assertTrue(sorted);
@@ -319,5 +319,5 @@
      */
     @Test
-    public void test_LOCAL_TLDS_sortedAndLowerCase() throws Exception {
+    void test_LOCAL_TLDS_sortedAndLowerCase() throws Exception {
         final boolean sorted = isSortedLowerCase("LOCAL_TLDS");
         assertTrue(sorted);
@@ -328,5 +328,5 @@
      */
     @Test
-    public void testEnumIsPublic() {
+    void testEnumIsPublic() {
         assertTrue(Modifier.isPublic(DomainValidator.ArrayType.class.getModifiers()));
     }
@@ -336,5 +336,5 @@
      */
     @Test
-    public void testUpdateBaseArrays() {
+    void testUpdateBaseArrays() {
         try {
             DomainValidator.updateTLDOverride(ArrayType.COUNTRY_CODE_RO, new String[]{"com"});
@@ -371,5 +371,5 @@
      */
     @Test
-    public void testGetArray() {
+    void testGetArray() {
         assertNotNull(DomainValidator.getTLDEntries(ArrayType.COUNTRY_CODE_MINUS));
         assertNotNull(DomainValidator.getTLDEntries(ArrayType.COUNTRY_CODE_PLUS));
@@ -386,5 +386,5 @@
      */
     @Test
-    public void testUpdateCountryCode() {
+    void testUpdateCountryCode() {
         assertFalse(validator.isValidCountryCodeTld("com")); // cannot be valid
         DomainValidator.updateTLDOverride(ArrayType.COUNTRY_CODE_PLUS, new String[]{"com"});
@@ -404,5 +404,5 @@
      */
     @Test
-    public void testUpdateGeneric() {
+    void testUpdateGeneric() {
         assertFalse(validator.isValidGenericTld("ch")); // cannot be valid
         DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"ch"});
@@ -422,5 +422,5 @@
      */
     @Test
-    public void testCannotUpdate() {
+    void testCannotUpdate() {
         DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"ch"}); // OK
         DomainValidator dv = DomainValidator.getInstance();
@@ -484,5 +484,5 @@
      */
     @Test
-    public void testValidatorName() {
+    void testValidatorName() {
         assertNull(DomainValidator.getInstance().getValidatorName());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java	(revision 17275)
@@ -47,6 +47,6 @@
 import java.util.regex.Pattern;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.Logging;
@@ -59,10 +59,10 @@
  * @version $Revision: 1723861 $
  */
-public class DomainValidatorTestIT {
+class DomainValidatorTestIT {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().https();
@@ -75,5 +75,5 @@
      */
     @Test
-    public void testIanaTldList() throws Exception {
+    void testIanaTldList() throws Exception {
         // Check the arrays first as this affects later checks
         // Doing this here makes it easier when updating the lists
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java	(revision 17275)
@@ -21,7 +21,7 @@
 import static org.junit.Assert.assertTrue;
 
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 /**
@@ -31,5 +31,5 @@
  * @version $Revision: 1741724 $
  */
-public class EmailValidatorTest {
+class EmailValidatorTest {
 
     /**
@@ -49,5 +49,5 @@
      * Setup
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         validator = EmailValidator.getInstance();
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testEmail() {
+    void testEmail() {
         assertTrue(validator.isValid("jsmith@apache.org"));
         assertFalse(validator.isValid(null));
@@ -67,5 +67,5 @@
      */
     @Test
-    public void testEmailWithNumericAddress() {
+    void testEmailWithNumericAddress() {
         assertTrue(validator.isValid("someone@[216.109.118.76]"));
         assertTrue(validator.isValid("someone@yahoo.com"));
@@ -76,5 +76,5 @@
      */
     @Test
-    public void testEmailExtension() {
+    void testEmailExtension() {
         assertTrue(validator.isValid("jsmith@apache.org"));
 
@@ -99,5 +99,5 @@
      */
     @Test
-    public void testEmailWithDash() {
+    void testEmailWithDash() {
         assertTrue(validator.isValid("andy.noble@data-workshop.com"));
 
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testEmailWithDotEnd() {
+    void testEmailWithDotEnd() {
         assertFalse(validator.isValid("andy.noble@data-workshop.com."));
     }
@@ -123,5 +123,5 @@
      */
     @Test
-    public void testEmailWithBogusCharacter() {
+    void testEmailWithBogusCharacter() {
 
         assertFalse(validator.isValid("andy.noble@\u008fdata-workshop.com"));
@@ -148,5 +148,5 @@
      */
     @Test
-    public void testVALIDATOR_315() {
+    void testVALIDATOR_315() {
         assertFalse(validator.isValid("me@at&t.net"));
         assertTrue(validator.isValid("me@att.net")); // Make sure TLD is not the cause of the failure
@@ -157,5 +157,5 @@
      */
     @Test
-    public void testVALIDATOR_278() {
+    void testVALIDATOR_278() {
         assertFalse(validator.isValid("someone@-test.com")); // hostname starts with dash/hyphen
         assertFalse(validator.isValid("someone@test-.com")); // hostname ends with dash/hyphen
@@ -166,5 +166,5 @@
      */
     @Test
-    public void testValidator235() {
+    void testValidator235() {
         String version = System.getProperty("java.version");
         if (version.compareTo("1.6") < 0) {
@@ -184,5 +184,5 @@
      */
     @Test
-    public void testEmailWithCommas() {
+    void testEmailWithCommas() {
         assertFalse(validator.isValid("joeblow@apa,che.org"));
 
@@ -196,5 +196,5 @@
      */
     @Test
-    public void testEmailWithSpaces() {
+    void testEmailWithSpaces() {
         assertFalse(validator.isValid("joeblow @apache.org")); // TODO - this should be valid?
 
@@ -215,5 +215,5 @@
      */
     @Test
-    public void testEmailWithControlChars() {
+    void testEmailWithControlChars() {
         for (char c = 0; c < 32; c++) {
             assertFalse("Test control char " + ((int) c), validator.isValid("foo" + c + "bar@domain.com"));
@@ -227,5 +227,5 @@
      */
     @Test
-    public void testEmailLocalhost() {
+    void testEmailLocalhost() {
        // Check the default is not to allow
        EmailValidator noLocal = EmailValidator.getInstance(false);
@@ -258,5 +258,5 @@
      */
     @Test
-    public void testEmailWithSlashes() {
+    void testEmailWithSlashes() {
        assertTrue(
              "/ and ! valid in username",
@@ -278,5 +278,5 @@
      */
     @Test
-    public void testEmailUserName() {
+    void testEmailUserName() {
 
         assertTrue(validator.isValid("joe1blow@apache.org"));
@@ -490,7 +490,7 @@
      * The real solution is to fix the email parsing.
      */
-    @Ignore("This test fails so disable it for 1.1.4 release. The real solution is to fix the email parsing")
-    @Test
-    public void testEmailFromPerl() {
+    @Disabled("This test fails so disable it for 1.1.4 release. The real solution is to fix the email parsing")
+    @Test
+    void testEmailFromPerl() {
         for (int index = 0; index < testEmailFromPerl.length; index++) {
             String item = testEmailFromPerl[index].item;
@@ -507,5 +507,5 @@
      */
     @Test
-    public void testValidator293() {
+    void testValidator293() {
         assertTrue(validator.isValid("abc-@abc.com"));
         assertTrue(validator.isValid("abc_@abc.com"));
@@ -519,5 +519,5 @@
      */
     @Test
-    public void testValidator365() {
+    void testValidator365() {
         assertFalse(validator.isValid(
                 "Loremipsumdolorsitametconsecteturadipiscingelit.Nullavitaeligulamattisrhoncusnuncegestasmattisleo."+
@@ -554,5 +554,5 @@
      */
     @Test
-    public void testEmailAtTLD() {
+    void testEmailAtTLD() {
         EmailValidator val = EmailValidator.getInstance(false, true);
         assertTrue(val.isValid("test@com"));
@@ -563,5 +563,5 @@
      */
     @Test
-    public void testValidator359() {
+    void testValidator359() {
         EmailValidator val = EmailValidator.getInstance(false, true);
         assertFalse(val.isValid("test@.com"));
@@ -572,5 +572,5 @@
      */
     @Test
-    public void testValidator374() {
+    void testValidator374() {
         assertTrue(validator.isValid("abc@school.school"));
     }
@@ -580,5 +580,5 @@
      */
     @Test
-    public void testValidatorName() {
+    void testValidatorName() {
         assertEquals("Email validator", EmailValidator.getInstance().getValidatorName());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/routines/InetAddressValidatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/routines/InetAddressValidatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/routines/InetAddressValidatorTest.java	(revision 17275)
@@ -15,5 +15,4 @@
  * limitations under the License.
  */
-
 package org.openstreetmap.josm.data.validation.routines;
 
@@ -22,6 +21,6 @@
 import static org.junit.Assert.assertTrue;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 /**
@@ -30,5 +29,5 @@
  * @version $Revision: 1741724 $
  */
-public class InetAddressValidatorTest {
+class InetAddressValidatorTest {
 
     private InetAddressValidator validator;
@@ -37,5 +36,5 @@
      * Setup
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         validator = new InetAddressValidator();
@@ -46,5 +45,5 @@
      */
     @Test
-    public void testInetAddressesFromTheWild() {
+    void testInetAddressesFromTheWild() {
         // CHECKSTYLE.OFF: SingleSpaceSeparator
         assertTrue("www.apache.org IP should be valid",   validator.isValid("140.211.11.130"));
@@ -59,5 +58,5 @@
      */
     @Test
-    public void testVALIDATOR_335() {
+    void testVALIDATOR_335() {
         assertTrue("2001:0438:FFFE:0000:0000:0000:0000:0A35 should be valid",
                 validator.isValid("2001:0438:FFFE:0000:0000:0000:0000:0A35"));
@@ -68,5 +67,5 @@
      */
     @Test
-    public void testInetAddressesByClass() {
+    void testInetAddressesByClass() {
         // CHECKSTYLE.OFF: SingleSpaceSeparator
         assertTrue("class A IP should be valid",            validator.isValid("24.25.231.12"));
@@ -91,5 +90,5 @@
      */
     @Test
-    public void testReservedInetAddresses() {
+    void testReservedInetAddresses() {
         assertTrue("localhost IP should be valid", validator.isValid("127.0.0.1"));
         assertTrue("broadcast IP should be valid", validator.isValid("255.255.255.255"));
@@ -100,5 +99,5 @@
      */
     @Test
-    public void testBrokenInetAddresses() {
+    void testBrokenInetAddresses() {
         // CHECKSTYLE.OFF: SingleSpaceSeparator
         assertFalse("IP with characters should be invalid",     validator.isValid("124.14.32.abc"));
@@ -119,5 +118,5 @@
      */
     @Test
-    public void testIPv6() {
+    void testIPv6() {
         // The original Perl script contained a lot of duplicate tests.
         // I removed the duplicates I noticed, but there may be more.
@@ -627,5 +626,5 @@
      */
     @Test
-    public void testValidatorName() {
+    void testValidatorName() {
         assertNull(new InetAddressValidator().getValidatorName());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/routines/RegexValidatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/routines/RegexValidatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/routines/RegexValidatorTest.java	(revision 17275)
@@ -21,10 +21,10 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.Arrays;
 import java.util.regex.PatternSyntaxException;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.tools.Logging;
 
@@ -35,5 +35,5 @@
  * @since Validator 1.4
  */
-public class RegexValidatorTest {
+class RegexValidatorTest {
 
     private static final String REGEX = "^([abc]*)(?:\\-)([DEF]*)(?:\\-)([123]*)$";
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testSingle() {
+    void testSingle() {
         RegexValidator sensitive   = new RegexValidator(REGEX);
         RegexValidator insensitive = new RegexValidator(REGEX, false);
@@ -84,5 +84,5 @@
      */
     @Test
-    public void testMultipleSensitive() {
+    void testMultipleSensitive() {
 
         // ------------ Set up Sensitive Validators
@@ -126,5 +126,5 @@
      */
     @Test
-    public void testMultipleInsensitive() {
+    void testMultipleInsensitive() {
 
         // ------------ Set up In-sensitive Validators
@@ -168,5 +168,5 @@
      */
     @Test
-    public void testNullValue() {
+    void testNullValue() {
         RegexValidator validator = new RegexValidator(REGEX);
         assertFalse("Instance isValid()", validator.isValid(null));
@@ -181,5 +181,5 @@
      */
     @Test
-    public void testMissingRegex() {
+    void testMissingRegex() {
 
         // Single Regular Expression - null
@@ -238,5 +238,5 @@
      */
     @Test
-    public void testExceptions() {
+    void testExceptions() {
         String invalidRegex = "^([abCD12]*$";
         try {
@@ -252,5 +252,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         RegexValidator single = new RegexValidator(REGEX);
         assertEquals("Single", "RegexValidator{" + REGEX + "}", single.toString());
@@ -264,5 +264,5 @@
      */
     @Test
-    public void testValidatorName() {
+    void testValidatorName() {
         assertNull(new RegexValidator(".*").getValidatorName());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java	(revision 17275)
@@ -21,6 +21,6 @@
 import static org.junit.Assert.assertTrue;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 /**
@@ -29,5 +29,5 @@
  * @version $Revision: 1741724 $
  */
-public class UrlValidatorTest {
+class UrlValidatorTest {
 
    private static final boolean printStatus = false;
@@ -37,5 +37,5 @@
     * Setup
     */
-   @Before
+   @BeforeEach
    public void setUp() {
       for (int index = 0; index < testPartsIndex.length - 1; index++) {
@@ -140,5 +140,5 @@
      */
     @Test
-    public void testValidator202() {
+    void testValidator202() {
         String[] schemes = {"http", "https"};
         UrlValidator urlValidator = new UrlValidator(schemes, UrlValidator.NO_FRAGMENTS);
@@ -151,5 +151,5 @@
      */
     @Test
-    public void testValidator204() {
+    void testValidator204() {
         String[] schemes = {"http", "https"};
         UrlValidator urlValidator = new UrlValidator(schemes);
@@ -161,5 +161,5 @@
      */
     @Test
-    public void testValidator218() {
+    void testValidator218() {
         UrlValidator validator = new UrlValidator(UrlValidator.ALLOW_2_SLASHES);
         assertTrue("parentheses should be valid in URLs",
@@ -171,5 +171,5 @@
      */
     @Test
-    public void testValidator235() {
+    void testValidator235() {
         String version = System.getProperty("java.version");
         if (version.compareTo("1.6") < 0) {
@@ -190,5 +190,5 @@
      */
     @Test
-    public void testValidator248() {
+    void testValidator248() {
         RegexValidator regex = new RegexValidator(new String[] {"localhost", ".*\\.my-testing"});
         UrlValidator validator = new UrlValidator(regex, 0);
@@ -224,5 +224,5 @@
      */
     @Test
-    public void testValidator288() {
+    void testValidator288() {
         UrlValidator validator = new UrlValidator(UrlValidator.ALLOW_LOCAL_URLS);
 
@@ -262,5 +262,5 @@
      */
     @Test
-    public void testValidator276() {
+    void testValidator276() {
         // file:// isn't allowed by default
         UrlValidator validator = new UrlValidator();
@@ -319,5 +319,5 @@
      */
     @Test
-    public void testValidator309() {
+    void testValidator309() {
         UrlValidator urlValidator = new UrlValidator();
         assertTrue(urlValidator.isValid("http://sample.ondemand.com/"));
@@ -334,5 +334,5 @@
      */
     @Test
-    public void testValidator339() {
+    void testValidator339() {
         UrlValidator urlValidator = new UrlValidator();
         assertTrue(urlValidator.isValid("http://www.cnn.com/WORLD/?hpt=sitenav")); // without
@@ -347,5 +347,5 @@
      */
     @Test
-    public void testValidator339IDN() {
+    void testValidator339IDN() {
         UrlValidator urlValidator = new UrlValidator();
         assertTrue(urlValidator.isValid("http://президент.рф/WORLD/?hpt=sitenav")); // without
@@ -360,5 +360,5 @@
      */
     @Test
-    public void testValidator342() {
+    void testValidator342() {
         UrlValidator urlValidator = new UrlValidator();
         assertTrue(urlValidator.isValid("http://example.rocks/"));
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/AddressesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/AddressesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/AddressesTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+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.openstreetmap.josm.data.coor.LatLon.NORTH_POLE;
 import static org.openstreetmap.josm.data.coor.LatLon.SOUTH_POLE;
@@ -11,6 +11,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -27,10 +27,10 @@
  * JUnit Test of {@link Addresses} validation test.
  */
-public class AddressesTest {
+class AddressesTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testHouseNumberWithoutStreet() {
+    void testHouseNumberWithoutStreet() {
         assertNull(doTestHouseNumberWithoutStreet("", null, null));
         assertNotNull(doTestHouseNumberWithoutStreet("addr:housenumber=1", null, null));
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testDuplicateHouseNumber() {
+    void testDuplicateHouseNumber() {
         String num1 = "addr:housenumber=1 addr:street=Foo ";
         String num2 = "addr:housenumber=2 addr:street=Foo ";
@@ -116,5 +116,5 @@
      */
     @Test
-    public void testMultiAddressDuplicates() {
+    void testMultiAddressDuplicates() {
         String num1 = "addr:housenumber=1,3 addr:street=Foo";
         String num2 = "addr:housenumber=1 addr:street=Foo";
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CoastlinesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CoastlinesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CoastlinesTest.java	(revision 17275)
@@ -4,6 +4,6 @@
 import java.util.stream.Collectors;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,5 +13,5 @@
  * JUnit Test of {@link Coastlines} validation test.
  */
-public class CoastlinesTest {
+class CoastlinesTest {
 
     private static final Coastlines COASTLINES = new Coastlines();
@@ -21,5 +21,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testCoastlineFile() throws Exception {
+    void testCoastlineFile() throws Exception {
         ValidatorTestUtils.testSampleFile("nodist/data/coastlines.osm",
                 ds -> ds.getWays().stream().filter(
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConditionalKeysTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
 
@@ -15,5 +15,5 @@
  * Unit test of {@link ConditionalKeys}.
  */
-public class ConditionalKeysTest {
+class ConditionalKeysTest {
 
     private final ConditionalKeys test = new ConditionalKeys();
@@ -22,5 +22,5 @@
      * Setup test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rule = new JOSMTestRules().presets();
@@ -30,5 +30,5 @@
      * @throws Exception if an error occurs
      */
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         test.initialize();
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testKeyValid() {
+    void testKeyValid() {
         assertTrue(test.isKeyValid("maxspeed:conditional"));
         assertTrue(test.isKeyValid("motor_vehicle:conditional"));
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testValueValid() {
+    void testValueValid() {
         assertTrue(test.isValueValid("maxspeed:conditional", "120 @ (06:00-19:00)"));
         assertFalse(test.isValueValid("maxspeed:conditional", " @ (06:00-19:00)"));
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConnectivityRelationsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConnectivityRelationsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ConnectivityRelationsTest.java	(revision 17275)
@@ -3,6 +3,6 @@
 
 import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
@@ -17,5 +17,5 @@
  * @author Taylor Smock
  */
-public class ConnectivityRelationsTest {
+class ConnectivityRelationsTest {
     private ConnectivityRelations check;
     private static final String CONNECTIVITY = "connectivity";
@@ -25,5 +25,5 @@
      * @throws Exception if an error occurs
      */
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         JOSMFixture.createUnitTestFixture().init();
@@ -43,5 +43,5 @@
      */
     @Test
-    public void testNoConnectivityTag() {
+    void testNoConnectivityTag() {
         Relation relation = createDefaultTestRelation();
         check.visit(relation);
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testMisMatchedLanes() {
+    void testMisMatchedLanes() {
         Relation relation = createDefaultTestRelation();
         check.visit(relation);
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.HashMap;
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -27,10 +27,10 @@
  * Unit test of {@link CrossingWays}.
  */
-public class CrossingWaysTest {
+class CrossingWaysTest {
 
     /**
      * Setup test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rule = new JOSMTestRules().preferences();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testGetSegments() {
+    void testGetSegments() {
         List<List<WaySegment>> list = CrossingWays.getSegments(new HashMap<>(), EastNorth.ZERO, EastNorth.ZERO);
         assertEquals(1, list.size());
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testIsCoastline() {
+    void testIsCoastline() {
         assertTrue(CrossingWays.isCoastline(TestUtils.newWay("natural=water")));
         assertTrue(CrossingWays.isCoastline(TestUtils.newWay("natural=coastline")));
@@ -69,5 +69,5 @@
      */
     @Test
-    public void testIsHighway() {
+    void testIsHighway() {
         assertTrue(CrossingWays.isHighway(TestUtils.newWay("highway=motorway")));
         assertFalse(CrossingWays.isHighway(TestUtils.newWay("highway=rest_area")));
@@ -78,5 +78,5 @@
      */
     @Test
-    public void testIsRailway() {
+    void testIsRailway() {
         assertTrue(CrossingWays.isRailway(TestUtils.newWay("railway=rail")));
         assertFalse(CrossingWays.isRailway(TestUtils.newWay("railway=subway")));
@@ -88,5 +88,5 @@
      */
     @Test
-    public void testIsSubwayOrTramOrRazed() {
+    void testIsSubwayOrTramOrRazed() {
         assertTrue(CrossingWays.isSubwayOrTramOrRazed(TestUtils.newWay("railway=subway")));
         assertTrue(CrossingWays.isSubwayOrTramOrRazed(TestUtils.newWay("railway=construction construction=tram")));
@@ -101,5 +101,5 @@
      */
     @Test
-    public void testIsProposedOrAbandoned() {
+    void testIsProposedOrAbandoned() {
         assertTrue(CrossingWays.isProposedOrAbandoned(TestUtils.newWay("highway=proposed")));
         assertTrue(CrossingWays.isProposedOrAbandoned(TestUtils.newWay("railway=proposed")));
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testWays() {
+    void testWays() {
         Ways test = new CrossingWays.Ways();
         // isPrimitiveUsable
@@ -157,5 +157,5 @@
      */
     @Test
-    public void testBoundaries() {
+    void testBoundaries() {
         Boundaries test = new CrossingWays.Boundaries();
         // isPrimitiveUsable
@@ -171,5 +171,5 @@
      */
     @Test
-    public void testSelfCrossing() {
+    void testSelfCrossing() {
         SelfCrossing test = new CrossingWays.SelfCrossing();
         // isPrimitiveUsable
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateNodeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateNodeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateNodeTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -20,10 +20,10 @@
  * JUnit Test of "Duplicate node" validation test.
  */
-public class DuplicateNodeTest {
+class DuplicateNodeTest {
 
     /**
      * Setup test by initializing JOSM preferences and projection.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -70,5 +70,5 @@
      */
     @Test
-    public void testDuplicateNode() {
+    void testDuplicateNode() {
         DataSet ds = new DataSet();
 
@@ -88,5 +88,5 @@
      */
     @Test
-    public void testDuplicateNodeMixed() {
+    void testDuplicateNodeMixed() {
         doTest(DuplicateNode.DUPLICATE_NODE_MIXED, new Tag("building", "foo"), new Tag("highway", "bar"));
     }
@@ -96,5 +96,5 @@
      */
     @Test
-    public void testDuplicateNodeOther() {
+    void testDuplicateNodeOther() {
         doTest(DuplicateNode.DUPLICATE_NODE_OTHER);
     }
@@ -104,5 +104,5 @@
      */
     @Test
-    public void testDuplicateNodeBuilding() {
+    void testDuplicateNodeBuilding() {
         doTest(DuplicateNode.DUPLICATE_NODE_BUILDING, new Tag("building", "foo"));
     }
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testDuplicateNodeBoundary() {
+    void testDuplicateNodeBoundary() {
         doTest(DuplicateNode.DUPLICATE_NODE_BOUNDARY, new Tag("boundary", "foo"));
     }
@@ -120,5 +120,5 @@
      */
     @Test
-    public void testDuplicateNodeHighway() {
+    void testDuplicateNodeHighway() {
         doTest(DuplicateNode.DUPLICATE_NODE_HIGHWAY, new Tag("highway", "foo"));
     }
@@ -128,5 +128,5 @@
      */
     @Test
-    public void testDuplicateNodeLanduse() {
+    void testDuplicateNodeLanduse() {
         doTest(DuplicateNode.DUPLICATE_NODE_LANDUSE, new Tag("landuse", "foo"));
     }
@@ -136,5 +136,5 @@
      */
     @Test
-    public void testDuplicateNodeNatural() {
+    void testDuplicateNodeNatural() {
         doTest(DuplicateNode.DUPLICATE_NODE_NATURAL, new Tag("natural", "foo"));
     }
@@ -144,5 +144,5 @@
      */
     @Test
-    public void testDuplicateNodePower() {
+    void testDuplicateNodePower() {
         doTest(DuplicateNode.DUPLICATE_NODE_POWER, new Tag("power", "foo"));
     }
@@ -152,5 +152,5 @@
      */
     @Test
-    public void testDuplicateNodeRailway() {
+    void testDuplicateNodeRailway() {
         doTest(DuplicateNode.DUPLICATE_NODE_RAILWAY, new Tag("railway", "foo"));
     }
@@ -160,5 +160,5 @@
      */
     @Test
-    public void testDuplicateNodeWaterway() {
+    void testDuplicateNodeWaterway() {
         doTest(DuplicateNode.DUPLICATE_NODE_WATERWAY, new Tag("waterway", "foo"));
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateRelationTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateRelationTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateRelationTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -20,10 +20,10 @@
  * JUnit Test of "Duplicate relation" validation test.
  */
-public class DuplicateRelationTest {
+class DuplicateRelationTest {
 
     /**
      * Setup test by initializing JOSM preferences and projection.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testDuplicateRelationNoTags() {
+    void testDuplicateRelationNoTags() {
         doTest("", "",
                 new ExpectedResult(DuplicateRelation.DUPLICATE_RELATION, true),
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testDuplicateRelationSameTags() {
+    void testDuplicateRelationSameTags() {
         doTest("type=boundary", "type=boundary",
                 new ExpectedResult(DuplicateRelation.DUPLICATE_RELATION, true),
@@ -91,5 +91,5 @@
      */
     @Test
-    public void testDuplicateRelationDifferentTags() {
+    void testDuplicateRelationDifferentTags() {
         doTest("type=boundary", "type=multipolygon",
                 new ExpectedResult(DuplicateRelation.SAME_RELATION, false));
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateWayTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateWayTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DuplicateWayTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.nio.file.Files;
 import java.nio.file.Paths;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.Command;
@@ -26,10 +26,10 @@
  * JUnit Test of "Duplicate way" validation test.
  */
-public class DuplicateWayTest {
+class DuplicateWayTest {
 
     /**
      * Setup test by initializing JOSM preferences and projection.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -76,5 +76,5 @@
      */
     @Test
-    public void testDuplicateWayNoTags() {
+    void testDuplicateWayNoTags() {
         doTest(DuplicateWay.DUPLICATE_WAY);
     }
@@ -84,5 +84,5 @@
      */
     @Test
-    public void testDuplicateWaySameTags() {
+    void testDuplicateWaySameTags() {
         doTest(DuplicateWay.DUPLICATE_WAY, "highway=motorway");
     }
@@ -92,5 +92,5 @@
      */
     @Test
-    public void testDuplicateWayDifferentTags() {
+    void testDuplicateWayDifferentTags() {
         doTest(DuplicateWay.SAME_WAY, "highway=motorway", "highway=trunk", false);
     }
@@ -101,5 +101,5 @@
      */
     @Test
-    public void testFixError() throws Exception {
+    void testFixError() throws Exception {
         DataSet ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "duplicate-ways.osm")), null);
         TEST.startTest(NullProgressMonitor.INSTANCE);
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/HighwaysTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/HighwaysTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/HighwaysTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.InputStream;
 import java.util.Collection;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
@@ -24,10 +24,10 @@
  * Unit test of {@link HighwaysTest}.
  */
-public class HighwaysTest {
+class HighwaysTest {
 
     /**
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -77,5 +77,5 @@
      */
     @Test
-    public void testCombinations() {
+    void testCombinations() {
         assertTrue(Highways.isHighwayLinkOkay(createTestSetting("primary", "primary_link")));
         assertTrue(Highways.isHighwayLinkOkay(createTestSetting("primary", "primary")));
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testSourceMaxSpeedUnitedKingdom() {
+    void testSourceMaxSpeedUnitedKingdom() {
         Way link = createTestSetting("primary", "primary");
         link.put("maxspeed", "60 mph");
@@ -108,5 +108,5 @@
      */
     @Test
-    public void testTicket14891() throws Exception {
+    void testTicket14891() throws Exception {
         try (InputStream is = TestUtils.getRegressionDataStream(14891, "14891.osm.bz2")) {
             Collection<Way> ways = OsmReader.parseDataSet(is, null).getWays();
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/InternetTagsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/InternetTagsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/InternetTagsTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.validation.TestError;
@@ -24,5 +24,5 @@
  * JUnit Test of "Internet Tags" validation test.
  */
-public class InternetTagsTest {
+class InternetTagsTest {
 
     private static final InternetTags TEST = new InternetTags();
@@ -31,5 +31,5 @@
      * Setup test by initializing JOSM preferences and projection.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testValidUrls() {
+    void testValidUrls() {
         testUrl("url", "www.domain.com", true);                                // No protocol
         testUrl("url", "http://josm.openstreetmap.de", true);                  // Simple HTTP
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testMultipleUrls() {
+    void testMultipleUrls() {
         testUrl("url", "http://www.domain-a.com;https://www.domain-b.com", true); // multiple values
     }
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testInvalidUrls() {
+    void testInvalidUrls() {
         testUrl("url", "something://www.domain.com", false);                   // invalid protocol
         testUrl("url", "http://www.domain.invalidtld", false);                 // invalid TLD
@@ -74,5 +74,5 @@
      */
     @Test
-    public void testValidEmails() {
+    void testValidEmails() {
         testEmail("email", "contact@www.domain.com", true);                    // Simple email
         testEmail("contact:email", "john.doe@other-domain.org", true);         // Key with : + dash in domain
@@ -83,5 +83,5 @@
      */
     @Test
-    public void testInvalidEmails() {
+    void testInvalidEmails() {
         testEmail("email", "contact at www.domain.com", false);                // No @
         testEmail("contact:email", "john.doe@other-domain.invalidtld", false); // invalid TLD
@@ -92,5 +92,5 @@
      */
     @Test
-    public void testInvalidSlashes() {
+    void testInvalidSlashes() {
         TestError error = testUrl("website", "http:\\\\www.sjoekurs.no", false).get(0);
         assertEquals(tr("''{0}'': {1}", "website", tr("URL contains backslashes instead of slashes")), error.getDescription());
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LanesTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmUtils;
@@ -13,5 +13,5 @@
  * Unit tests of {@link Lanes}.
  */
-public class LanesTest {
+class LanesTest {
 
     private final Lanes lanes = new Lanes();
@@ -21,5 +21,5 @@
      * @throws Exception if an error occurs
      */
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testLanesCount() {
+    void testLanesCount() {
         assertEquals(0, Lanes.getLanesCount(""));
         assertEquals(1, Lanes.getLanesCount("left"));
@@ -41,5 +41,5 @@
 
     @Test
-    public void test1() {
+    void test1() {
         lanes.check(OsmUtils.createPrimitive("way turn:lanes=left|right change:lanes=only_left|not_right|yes"));
         assertEquals("Number of lane dependent values inconsistent", lanes.getErrors().get(0).getMessage());
@@ -47,5 +47,5 @@
 
     @Test
-    public void test2() {
+    void test2() {
         lanes.check(OsmUtils.createPrimitive("way width:lanes:forward=1|2|3 psv:lanes:forward=no|designated"));
         assertEquals("Number of lane dependent values inconsistent in forward direction", lanes.getErrors().get(0).getMessage());
@@ -53,5 +53,5 @@
 
     @Test
-    public void test3() {
+    void test3() {
         lanes.check(OsmUtils.createPrimitive("way change:lanes:forward=yes|no turn:lanes:backward=left|right|left"));
         assertTrue(lanes.getErrors().isEmpty());
@@ -59,5 +59,5 @@
 
     @Test
-    public void test4() {
+    void test4() {
         lanes.check(OsmUtils.createPrimitive("way turn:lanes:forward=left|right change:lanes:forward=yes|no|yes width:backward=1|2|3"));
         assertEquals("Number of lane dependent values inconsistent in forward direction", lanes.getErrors().get(0).getMessage());
@@ -65,5 +65,5 @@
 
     @Test
-    public void test5() {
+    void test5() {
         lanes.check(OsmUtils.createPrimitive("way lanes:forward=5 turn:lanes:forward=left|right"));
         assertEquals("Number of lanes:forward greater than *:lanes:forward", lanes.getErrors().get(0).getMessage());
@@ -71,5 +71,5 @@
 
     @Test
-    public void test6() {
+    void test6() {
         lanes.check(OsmUtils.createPrimitive("way lanes:forward=foo|bar turn:lanes:forward=foo+bar"));
         assertTrue(lanes.getErrors().isEmpty());
@@ -77,5 +77,5 @@
 
     @Test
-    public void test7() {
+    void test7() {
         lanes.check(OsmUtils.createPrimitive("way lanes=3 lanes:forward=3 lanes:backward=7"));
         assertEquals("Number of lanes:forward+lanes:backward greater than lanes", lanes.getErrors().get(0).getMessage());
@@ -83,5 +83,5 @@
 
     @Test
-    public void test8() {
+    void test8() {
         lanes.check(OsmUtils.createPrimitive(
                 "way destination:country:lanes=X|Y;Z|none destination:ref:lanes=xyz|| destination:sign:lanes=none|airport|none"));
@@ -90,5 +90,5 @@
 
     @Test
-    public void test9() {
+    void test9() {
         lanes.check(OsmUtils.createPrimitive("way highway=secondary lanes=2 source:lanes=survey"));
         assertTrue(lanes.getErrors().isEmpty());
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LongSegmentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LongSegmentTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/LongSegmentTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.Node;
@@ -16,10 +16,10 @@
  * JUnit Test of "Long Segment" validation test.
  */
-public class LongSegmentTest {
+class LongSegmentTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testLongSegment() throws Exception {
+    void testLongSegment() throws Exception {
         // Long way
         Way w = new Way();
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.InputStream;
@@ -16,7 +16,7 @@
 import java.util.Set;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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.ChangePropertyCommand;
@@ -51,10 +51,10 @@
  * JUnit Test of {@link MapCSSTagChecker}.
  */
-public class MapCSSTagCheckerTest {
+class MapCSSTagCheckerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().territories().preferences();
@@ -63,5 +63,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         MapCSSTagCheckerAsserts.clear();
@@ -72,5 +72,5 @@
         Set<String> errors = new HashSet<>();
         test.checks.putAll("test", TagCheck.readMapCSS(new StringReader(css), errors::add).parseChecks);
-        assertTrue(errors.toString(), errors.isEmpty());
+        assertTrue(errors.isEmpty(), errors::toString);
         return test;
     }
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testNaturalMarsh() throws ParseException {
+    void testNaturalMarsh() throws ParseException {
         ParseResult result = TagCheck.readMapCSS(new StringReader(
                 "*[natural=marsh] {\n" +
@@ -122,5 +122,5 @@
      */
     @Test
-    public void testTicket10913() throws ParseException {
+    void testTicket10913() throws ParseException {
         final OsmPrimitive p = TestUtils.addFakeDataSet(TestUtils.newWay("highway=tertiary construction=yes"));
         final TagCheck check = TagCheck.readMapCSS(new StringReader("way {" +
@@ -141,5 +141,5 @@
      */
     @Test
-    public void testTicket9782() throws ParseException {
+    void testTicket9782() throws ParseException {
         final MapCSSTagChecker test = buildTagChecker("*[/.+_name/][!name] {" +
                 "throwWarning: tr(\"has {0} but not {1}\", \"{0.key}\", \"{1.key}\");}");
@@ -156,5 +156,5 @@
      */
     @Test
-    public void testTicket10859() throws ParseException {
+    void testTicket10859() throws ParseException {
         final MapCSSTagChecker test = buildTagChecker("way[highway=footway][foot?!] {\n" +
                 "  throwWarning: tr(\"{0} used with {1}\", \"{0.value}\", \"{1.tag}\");}");
@@ -171,5 +171,5 @@
      */
     @Test
-    public void testTicket13630() throws ParseException {
+    void testTicket13630() throws ParseException {
         ParseResult result = TagCheck.readMapCSS(new StringReader(
                 "node[crossing=zebra] {fixRemove: \"crossing=zebra\";}"));
@@ -183,5 +183,5 @@
      */
     @Test
-    public void testPreprocessing() throws ParseException {
+    void testPreprocessing() throws ParseException {
         final MapCSSTagChecker test = buildTagChecker(
                 "@supports (min-josm-version: 0) { *[foo] { throwWarning: \"!\"; } }\n" +
@@ -196,10 +196,10 @@
      */
     @Test
-    public void testInit() throws Exception {
+    void testInit() throws Exception {
         Logging.clearLastErrorAndWarnings();
         MapCSSTagChecker c = new MapCSSTagChecker();
         c.initialize();
 
-        assertTrue("no warnings/errors are logged", Logging.getLastErrorAndWarnings().isEmpty());
+        assertTrue(Logging.getLastErrorAndWarnings().isEmpty(), "no warnings/errors are logged");
 
         // to trigger MapCSSStyleIndex code
@@ -214,5 +214,5 @@
      */
     @Test
-    public void testAssertions() throws Exception {
+    void testAssertions() throws Exception {
         MapCSSTagChecker c = new MapCSSTagChecker();
         Set<String> assertionErrors = new LinkedHashSet<>();
@@ -226,5 +226,5 @@
             Logging.error(msg);
         }
-        assertTrue("not all assertions included in the tests are met", assertionErrors.isEmpty());
+        assertTrue(assertionErrors.isEmpty(), "not all assertions included in the tests are met");
     }
 
@@ -234,5 +234,5 @@
      */
     @Test
-    public void testAssertInsideCountry() throws ParseException {
+    void testAssertInsideCountry() throws ParseException {
         final MapCSSTagChecker test = buildTagChecker(
                 "node[amenity=parking][inside(\"BR\")] {\n" +
@@ -249,5 +249,5 @@
      */
     @Test
-    public void testTicket17058() throws ParseException {
+    void testTicket17058() throws ParseException {
         final MapCSSTagChecker test = buildTagChecker(
                 "*[name =~ /(?i).*Straße.*/][inside(\"LI,CH\")] {\n" +
@@ -264,5 +264,5 @@
      */
     @Test
-    public void testTicket13762() throws ParseException {
+    void testTicket13762() throws ParseException {
         final ParseResult parseResult = TagCheck.readMapCSS(new StringReader("" +
                 "meta[lang=de] {\n" +
@@ -277,5 +277,5 @@
      */
     @Test
-    public void testTicket14287() throws Exception {
+    void testTicket14287() throws Exception {
         final MapCSSTagChecker test = buildTagChecker(
                 "node[amenity=parking] ∈ *[amenity=parking] {" +
@@ -293,5 +293,5 @@
      */
     @Test
-    public void testTicket17053() throws ParseException {
+    void testTicket17053() throws ParseException {
         final MapCSSTagChecker test = buildTagChecker(
                 "way[highway=cycleway][cycleway=track] {\n" +
@@ -336,5 +336,5 @@
      */
     @Test
-    public void testTicket12627() throws Exception {
+    void testTicket12627() throws Exception {
         doTestNaturalWood(12627, "overlapping.osm", 1, 1);
     }
@@ -345,5 +345,5 @@
      */
     @Test
-    public void testTicket14289() throws Exception {
+    void testTicket14289() throws Exception {
         doTestNaturalWood(14289, "example2.osm", 3, 3);
     }
@@ -354,5 +354,5 @@
      */
     @Test
-    public void testTicket15641() throws ParseException {
+    void testTicket15641() throws ParseException {
         assertNotNull(buildTagChecker(
                 "relation[type=public_transport][public_transport=stop_area_group] > way {" +
@@ -366,5 +366,5 @@
      */
     @Test
-    public void testTicket17358() throws ParseException {
+    void testTicket17358() throws ParseException {
         final Collection<TestError> errors = buildTagChecker(
                 "*[/^name/=~/Test/]{" +
@@ -379,5 +379,5 @@
      */
     @Test
-    public void testTicket17695() throws Exception {
+    void testTicket17695() throws Exception {
         final MapCSSTagChecker test = buildTagChecker(
                 "*[building] ∈  *[building] {" +
@@ -396,5 +396,5 @@
      */
     @Test
-    public void testTicket13165() throws Exception {
+    void testTicket13165() throws Exception {
         final MapCSSTagChecker test = buildTagChecker(
                 "area:closed[tag(\"landuse\") = parent_tag(\"landuse\")] ⧉ area:closed[landuse] {"
@@ -413,5 +413,5 @@
      */
     @Test
-    public void testTicket13165IncompleteMP() throws Exception {
+    void testTicket13165IncompleteMP() throws Exception {
         final MapCSSTagChecker test = buildTagChecker(
                 "area:closed[tag(\"landuse\") = parent_tag(\"landuse\")] ⧉ area:closed[landuse] {"
@@ -431,5 +431,5 @@
      */
     @Test
-    public void testTicket19053() throws ParseException {
+    void testTicket19053() throws ParseException {
         final MapCSSTagChecker test = buildTagChecker(
                 "*[ele][ele =~ /^-?[0-9]+\\.[0-9][0-9][0-9]+$/] {"
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.InputStream;
 import java.util.stream.Collectors;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -20,5 +20,5 @@
  * JUnit Test of Multipolygon validation test.
  */
-public class MultipolygonTestTest {
+class MultipolygonTestTest {
 
 
@@ -26,5 +26,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main().preferences();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testMultipolygonFile() throws Exception {
+    void testMultipolygonFile() throws Exception {
         final MultipolygonTest MULTIPOLYGON_TEST = new MultipolygonTest();
         final RelationChecker RELATION_TEST = new RelationChecker();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testTicket17768TouchingInner() throws Exception {
+    void testTicket17768TouchingInner() throws Exception {
         try (InputStream is = TestUtils.getRegressionDataStream(17768, "touching-inner.osm")) {
             MultipolygonTest mpTest = new MultipolygonTest();
@@ -62,5 +62,5 @@
      */
     @Test
-    public void testTicket17768TouchingInnerOuter() throws Exception {
+    void testTicket17768TouchingInnerOuter() throws Exception {
         try (InputStream is = TestUtils.getRegressionDataStream(17768, "touching-inner-outer.osm")) {
             MultipolygonTest mpTest = new MultipolygonTest();
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.OsmUtils;
 import org.openstreetmap.josm.data.validation.TestError;
@@ -17,10 +17,10 @@
  * JUnit Test of "Name mismatch" validation test.
  */
-public class NameMismatchTest {
+class NameMismatchTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testCase0() {
+    void testCase0() {
         final List<TestError> errors = test("node name:de=Europa");
         assertEquals(1, errors.size());
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testCase1() {
+    void testCase1() {
         final List<TestError> errors = test("node name=Europe name:de=Europa");
         assertEquals(1, errors.size());
@@ -56,5 +56,5 @@
      */
     @Test
-    public void testCase2() {
+    void testCase2() {
         final List<TestError> errors = test("node name=Europe name:de=Europa name:en=Europe");
         assertEquals(0, errors.size());
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testCase3() {
+    void testCase3() {
         List<TestError> errors;
         errors = test("node \"name\"=\"Italia - Italien - Italy\"");
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testEtymologyWikidata() {
+    void testEtymologyWikidata() {
         final List<TestError> errors = test("node name=Foo name:etymology:wikidata=Bar");
         assertEquals(0, errors.size());
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java	(revision 17275)
@@ -6,7 +6,7 @@
 import static org.hamcrest.CoreMatchers.not;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -17,7 +17,7 @@
 import java.util.Set;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -41,9 +41,9 @@
  * @see OpeningHourTest
  */
-public class OpeningHourTestTest {
+class OpeningHourTestTest {
     /**
      * We need preferences for this. We check strings so we need i18n.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().i18n();
@@ -55,5 +55,5 @@
      * @throws Exception if test cannot be initialized
      */
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         openingHourTest = new OpeningHourTest();
@@ -66,5 +66,5 @@
      */
     @Test
-    public void testCheckOpeningHourSyntax1() {
+    void testCheckOpeningHourSyntax1() {
         final String key = "opening_hours";
         // frequently used tags according to https://taginfo.openstreetmap.org/keys/opening_hours#values
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testI18n() {
+    void testI18n() {
         final String key = "opening_hours";
         String value = ".";
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testCheckOpeningHourSyntax2() {
+    void testCheckOpeningHourSyntax2() {
         final String key = "opening_hours";
         final List<TestError> errors = checkOpeningHourSyntax(key, "Mo-Tue");
@@ -113,5 +113,5 @@
      */
     @Test
-    public void testCheckOpeningHourSyntax3() {
+    void testCheckOpeningHourSyntax3() {
         final String key = "opening_hours";
         final List<TestError> errors = checkOpeningHourSyntax(key, "Sa-Su 10.00-20.00");
@@ -126,5 +126,5 @@
      */
     @Test
-    public void testCheckOpeningHourSyntax4() {
+    void testCheckOpeningHourSyntax4() {
         assertThat(checkOpeningHourSyntax(null, null), isEmpty());
         assertThat(checkOpeningHourSyntax(null, ""), isEmpty());
@@ -139,5 +139,5 @@
      */
     @Test
-    public void testCheckOpeningHourSyntax5() {
+    void testCheckOpeningHourSyntax5() {
         final String key = "opening_hours";
         assertThat(checkOpeningHourSyntax(key, "badtext"), hasSize(1));
@@ -153,5 +153,5 @@
      */
     @Test
-    public void testCheckOpeningHourSyntax6() {
+    void testCheckOpeningHourSyntax6() {
         final String key = "opening_hours";
         assertThat(checkOpeningHourSyntax(key, "PH open \"always open on public holidays\""), isEmpty());
@@ -162,5 +162,5 @@
      */
     @Test
-    public void testCheckOpeningHourSyntax7() {
+    void testCheckOpeningHourSyntax7() {
         final String key = "opening_hours";
         assertThat(checkOpeningHourSyntax(key, "9:00-18:00"), hasSize(1));
@@ -173,5 +173,5 @@
      */
     @Test
-    public void testCheckOpeningHourSyntaxTicket9367() {
+    void testCheckOpeningHourSyntaxTicket9367() {
         final String key = "opening_hours";
         assertEquals(Severity.WARNING, checkOpeningHourSyntax(key, "Mo,Tu 04-17").get(0).getSeverity());
@@ -184,5 +184,5 @@
      */
     @Test
-    public void testCheckServiceTimeSyntax1() {
+    void testCheckServiceTimeSyntax1() {
         final String key = "service_times";
         // frequently used tags according to https://taginfo.openstreetmap.org/keys/service_times#values
@@ -203,5 +203,5 @@
      */
     @Test
-    public void testCheckCollectionTimeSyntax1() {
+    void testCheckCollectionTimeSyntax1() {
         final String key = "collection_times";
         // frequently used tags according to https://taginfo.openstreetmap.org/keys/collection_times#values
@@ -221,5 +221,5 @@
      */
     @Test
-    public void testPresetValues() {
+    void testPresetValues() {
         final Collection<TaggingPreset> presets = TaggingPresetReader.readFromPreferences(false, false);
         final Set<Tag> values = new LinkedHashSet<>();
@@ -247,5 +247,5 @@
      */
     @Test
-    public void testTicket17932() {
+    void testTicket17932() {
         Logging.clearLastErrorAndWarnings();
         assertTrue(checkOpeningHourSyntax("opening_hours", "SH off").isEmpty());
@@ -261,6 +261,6 @@
 
     private static void assertFixEquals(String value, TestError error) {
-        assertNotNull("fix is not null", error.getFix());
-        assertTrue("fix is ChangePropertyCommand", error.getFix() instanceof ChangePropertyCommand);
+        assertNotNull(error.getFix(), "fix is not null");
+        assertTrue(error.getFix() instanceof ChangePropertyCommand, "fix is ChangePropertyCommand");
         final ChangePropertyCommand command = (ChangePropertyCommand) error.getFix();
         assertEquals(1, command.getTags().size());
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/PublicTransportRouteTestTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/PublicTransportRouteTestTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/PublicTransportRouteTestTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Node;
@@ -21,5 +21,5 @@
  * JUnit Test of "Public Transport Route" validation test.
  */
-public class PublicTransportRouteTestTest {
+class PublicTransportRouteTestTest {
 
     final PublicTransportRouteTest test = new PublicTransportRouteTest();
@@ -28,5 +28,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testVarious() {
+    void testVarious() {
         final List<Node> nodes = Arrays.asList(new Node(), new Node(), new Node(), new Node(), new Node(), new Node());
         final Way w1 = TestUtils.newWay("", nodes.get(0), nodes.get(1));
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/RelationCheckerTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.openstreetmap.josm.data.osm.OsmUtils.createPrimitive;
 
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmUtils;
@@ -23,9 +23,9 @@
  * Unit tests of {@link RelationChecker} class.
  */
-public class RelationCheckerTest {
+class RelationCheckerTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rule = new JOSMTestRules().presets();
@@ -48,5 +48,5 @@
 
     @Test
-    public void testUnknownType() {
+    void testUnknownType() {
         Relation r = createRelation("type=foobar");
         r.addMember(new RelationMember("", new Way()));
@@ -58,5 +58,5 @@
 
     @Test
-    public void testEmpty() {
+    void testEmpty() {
         List<TestError> errors = testRelation(createRelation("type=multipolygon"));
         assertEquals(1, errors.size());
@@ -65,5 +65,5 @@
 
     @Test
-    public void testNormal() {
+    void testNormal() {
         Relation r = createRelation("type=multipolygon");
         r.addMember(new RelationMember("outer", new Way()));
@@ -73,5 +73,5 @@
 
     @Test
-    public void testOuter2() {
+    void testOuter2() {
         Relation r = createRelation("type=multipolygon");
         r.addMember(new RelationMember("outer", new Way()));
@@ -84,5 +84,5 @@
 
     @Test
-    public void testRestrictionViaMissing() {
+    void testRestrictionViaMissing() {
         Relation r = createRelation("type=restriction");
         r.addMember(new RelationMember("from", new Way()));
@@ -95,5 +95,5 @@
 
     @Test
-    public void testRestrictionViaRelation() {
+    void testRestrictionViaRelation() {
         Relation r = createRelation("type=restriction");
         r.addMember(new RelationMember("from", new Way()));
@@ -108,5 +108,5 @@
 
     @Test
-    public void testRestrictionTwoFrom() {
+    void testRestrictionTwoFrom() {
         Relation r = createRelation("type=restriction");
         r.addMember(new RelationMember("from", new Way()));
@@ -121,5 +121,5 @@
 
     @Test
-    public void testRestrictionEmpty() {
+    void testRestrictionEmpty() {
         Relation r = createRelation("type=restriction");
         r.addMember(new RelationMember("from", new Way()));
@@ -134,5 +134,5 @@
 
     @Test
-    public void testPowerMemberExpression() {
+    void testPowerMemberExpression() {
         Relation r = createRelation("type=route route=power");
         r.addMember(new RelationMember("", new Way()));
@@ -145,5 +145,5 @@
 
     @Test
-    public void testBuildingMemberExpression() {
+    void testBuildingMemberExpression() {
         Relation r = createRelation("type=building");
         r.addMember(new RelationMember("outline", new Way()));
@@ -161,5 +161,5 @@
 
     @Test
-    public void testHikingRouteMembers() {
+    void testHikingRouteMembers() {
         Relation r = createRelation("type=route route=hiking");
         r.addMember(new RelationMember("", OsmUtils.createPrimitive("way highway=path")));
@@ -176,5 +176,5 @@
 
     @Test
-    public void testRouteMemberExpression() {
+    void testRouteMemberExpression() {
         Relation r = createRelation("type=route route=tram public_transport:version=2");
         r.addMember(new RelationMember("", createPrimitive("way railway=tram")));
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java	(revision 17275)
@@ -8,6 +8,6 @@
 
 import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -19,5 +19,5 @@
  * JUnit Test of Multipolygon validation test.
  */
-public class SelfIntersectingWayTest {
+class SelfIntersectingWayTest {
 
     /**
@@ -25,5 +25,5 @@
      * @throws Exception if test cannot be initialized
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() throws Exception {
         JOSMFixture.createUnitTestFixture().init();
@@ -45,5 +45,5 @@
      */
     @Test
-    public void testUnclosedWayNormal() {
+    void testUnclosedWayNormal() {
         List<Node> nodes = createNodes();
 
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testUnclosedWayFirst() {
+    void testUnclosedWayFirst() {
         List<Node> nodes = createNodes();
 
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testUnclosedWayFirstRepeated() {
+    void testUnclosedWayFirstRepeated() {
         List<Node> nodes = createNodes();
 
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testUnclosedWayLast() {
+    void testUnclosedWayLast() {
         List<Node> nodes = createNodes();
 
@@ -134,5 +134,5 @@
      */
     @Test
-    public void testClosedWay() {
+    void testClosedWay() {
         List<Node> nodes = createNodes();
 
@@ -158,5 +158,5 @@
      */
     @Test
-    public void testSpikeWithStartInClosedWay() {
+    void testSpikeWithStartInClosedWay() {
         List<Node> nodes = createNodes();
 
@@ -181,5 +181,5 @@
      */
     @Test
-    public void testSpikeWithEndInClosedWay() {
+    void testSpikeWithEndInClosedWay() {
         List<Node> nodes = createNodes();
 
@@ -204,5 +204,5 @@
      */
     @Test
-    public void testSpikeInClosedWay() {
+    void testSpikeInClosedWay() {
         List<Node> nodes = createNodes();
 
@@ -227,5 +227,5 @@
      */
     @Test
-    public void testClosedWayBarbell() {
+    void testClosedWayBarbell() {
         List<Node> nodes = createNodes();
 
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SharpAnglesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SharpAnglesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SharpAnglesTest.java	(revision 17275)
@@ -3,6 +3,6 @@
 
 import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
@@ -14,6 +14,5 @@
  * JUnit Test of the Sharp Angles validation test.
  */
-
-public class SharpAnglesTest {
+class SharpAnglesTest {
     private SharpAngles angles;
 
@@ -22,5 +21,5 @@
      * @throws Exception if an error occurs
      */
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         JOSMFixture.createUnitTestFixture().init();
@@ -33,5 +32,5 @@
      */
     @Test
-    public void testClosedLoopNoSharpAngles() {
+    void testClosedLoopNoSharpAngles() {
         Way way = TestUtils.newWay("highway=residential",
                 new Node(new LatLon(0, 0)), new Node(new LatLon(0.1, 0.1)),
@@ -46,5 +45,5 @@
      */
     @Test
-    public void testClosedLoopSharpAngles() {
+    void testClosedLoopSharpAngles() {
         Way way = TestUtils.newWay("highway=residential",
                 new Node(new LatLon(0, 0)), new Node(new LatLon(0.1, 0.1)),
@@ -60,5 +59,5 @@
      */
     @Test
-    public void testMultipleSharpAngles() {
+    void testMultipleSharpAngles() {
         Way way = TestUtils.newWay("highway=residential",
                 new Node(new LatLon(0.005069377713748322, -0.0014832642674429382)),
@@ -75,5 +74,5 @@
      */
     @Test
-    public void testNoSharpAngles() {
+    void testNoSharpAngles() {
         Way way = TestUtils.newWay("highway=residential",
                 new Node(new LatLon(0, 0)), new Node(new LatLon(0.1, 0.1)),
@@ -88,5 +87,5 @@
      */
     @Test
-    public void testCheckBadAnglesFromSameNodeTwice() {
+    void testCheckBadAnglesFromSameNodeTwice() {
         Way way = TestUtils.newWay("highway=service oneway=yes",
                 new Node(new LatLon(52.8903308, 8.4302322)),
@@ -106,5 +105,5 @@
      */
     @Test
-    public void testIgnoredCases() {
+    void testIgnoredCases() {
         Way way = TestUtils.newWay("highway=residential",
                 new Node(new LatLon(0, 0)), new Node(new LatLon(0.1, 0.1)),
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SimilarNamedWaysTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SimilarNamedWaysTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SimilarNamedWaysTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 
@@ -12,5 +12,5 @@
  * Unit test of {@link SimilarNamedWays}
  */
-public class SimilarNamedWaysTest {
+class SimilarNamedWaysTest {
 
     private final SimilarNamedWays test = new SimilarNamedWays();
@@ -19,5 +19,5 @@
      * Setup test
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
     private void checkSimilarity(String message, String name1, String name2, boolean expected) {
         boolean actual = test.similaryName(name1, name2);
-        assertEquals(message, expected, actual);
+        assertEquals(expected, actual, message);
     }
 
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testSimilarNames() {
+    void testSimilarNames() {
         checkSimilarity("same string", "Testname", "Testname", false);
         checkSimilarity("different case", "Testname", "TestName", true);
@@ -81,5 +81,5 @@
       */
      @Test
-     public void testSimilarNamesRegression() {
+     void testSimilarNamesRegression() {
          assertFalse(test.similaryName("Unnecessary Name", "Third"));
      }
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -12,7 +12,7 @@
 
 import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -28,10 +28,10 @@
  * JUnit Test of {@link TagChecker}.
  */
-public class TagCheckerTest {
+class TagCheckerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rule = new JOSMTestRules().presets();
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testMisspelledKey1() throws IOException {
+    void testMisspelledKey1() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node Name=Main"));
         assertEquals(1, errors.size());
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testMisspelledKey2() throws IOException {
+    void testMisspelledKey2() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node landuse;=forest"));
         assertEquals(1, errors.size());
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testMisspelledKeyButAlternativeInUse() throws IOException {
+    void testMisspelledKeyButAlternativeInUse() throws IOException {
         // ticket 12329
         final List<TestError> errors = test(OsmUtils.createPrimitive("node amenity=fuel brand=bah Brand=foo"));
@@ -97,5 +97,5 @@
      */
     @Test
-    public void testUpperCaseIgnoredKey() throws IOException {
+    void testUpperCaseIgnoredKey() throws IOException {
         // ticket 17468
         final List<TestError> errors = test(OsmUtils.createPrimitive("node wheelchair:Description=bla"));
@@ -113,5 +113,5 @@
      */
     @Test
-    public void testUpperCaseInKeyIgnoredTag() throws IOException {
+    void testUpperCaseInKeyIgnoredTag() throws IOException {
         // ticket 17468
         final List<TestError> errors = test(OsmUtils.createPrimitive("node land_Area=administrative"));
@@ -128,5 +128,5 @@
      */
     @Test
-    public void testTranslatedNameKey() throws IOException {
+    void testTranslatedNameKey() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node namez=Baz"));
         assertEquals(1, errors.size());
@@ -142,5 +142,5 @@
      */
     @Test
-    public void testMisspelledTag() throws IOException {
+    void testMisspelledTag() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node landuse=forrest"));
         assertEquals(1, errors.size());
@@ -156,5 +156,5 @@
      */
     @Test
-    public void testMisspelledTag2() throws IOException {
+    void testMisspelledTag2() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node highway=servics"));
         assertEquals(1, errors.size());
@@ -172,5 +172,5 @@
      */
     @Test
-    public void testMisspelledTag3() throws IOException {
+    void testMisspelledTag3() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node highway=residentail"));
         assertEquals(1, errors.size());
@@ -187,5 +187,5 @@
      */
     @Test
-    public void testShortValNotInPreset2() throws IOException {
+    void testShortValNotInPreset2() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node shop=abs"));
         assertEquals(1, errors.size());
@@ -201,5 +201,5 @@
      */
     @Test
-    public void testIgnoredTagsNotInPresets() throws IOException {
+    void testIgnoredTagsNotInPresets() throws IOException {
         new TagChecker().initialize();
         List<String> errors = TagChecker.getIgnoredTags().stream()
@@ -207,5 +207,5 @@
                 .map(Tag::toString)
                 .collect(Collectors.toList());
-        assertTrue(errors.toString(), errors.isEmpty());
+        assertTrue(errors.isEmpty(), errors::toString);
     }
 
@@ -215,5 +215,5 @@
      */
     @Test
-    public void testTooShortToFix() throws IOException {
+    void testTooShortToFix() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node surface=u"));
         assertEquals(1, errors.size());
@@ -229,5 +229,5 @@
      */
     @Test
-    public void testValueDifferentCase() throws IOException {
+    void testValueDifferentCase() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node highway=Residential"));
         assertEquals(1, errors.size());
@@ -244,5 +244,5 @@
      */
     @Test
-    public void testRegression17246() throws IOException {
+    void testRegression17246() throws IOException {
         final List<TestError> errors = test(OsmUtils.createPrimitive("node access=privat"));
         assertEquals(1, errors.size());
@@ -274,5 +274,5 @@
      */
     @Test
-    public void testContainsRemoveUnwantedNonprintingControlCharacters() {
+    void testContainsRemoveUnwantedNonprintingControlCharacters() {
         // Check empty string is handled
         doTestUnwantedNonprintingControlCharacters("", Assert::assertFalse, "");
@@ -311,5 +311,5 @@
      */
     @Test
-    public void testTicket17667() {
+    void testTicket17667() {
         assertFalse(TagChecker.containsUnusualUnicodeCharacter("name", "Bus 118: Berlin, Rathaus Zehlendorf => Potsdam, Drewitz Stern-Center"));
         assertFalse(TagChecker.containsUnusualUnicodeCharacter("name", "Καρδίτσα → Λάρισα"));
@@ -324,5 +324,5 @@
      */
     @Test
-    public void testTicket18322() {
+    void testTicket18322() {
         assertTrue(TagChecker.containsUnusualUnicodeCharacter("name", "D36ᴬ"));
         assertFalse(TagChecker.containsUnusualUnicodeCharacter("ref", "D36ᴬ"));
@@ -337,5 +337,5 @@
      */
     @Test
-    public void testTicket18449() {
+    void testTicket18449() {
         assertFalse(TagChecker.containsUnusualUnicodeCharacter("name", "Hökumət Evi"));
     }
@@ -345,5 +345,5 @@
      */
     @Test
-    public void testTicket18740() {
+    void testTicket18740() {
         assertFalse(TagChecker.containsUnusualUnicodeCharacter("name:ak", "Frɛnkyeman"));
         assertFalse(TagChecker.containsUnusualUnicodeCharacter("name:bm", "Esipaɲi"));
@@ -356,18 +356,19 @@
      */
     @Test
-    public void testObjectTypeNotSupportedByPreset() throws IOException {
+    void testObjectTypeNotSupportedByPreset() throws IOException {
         List<TestError> errors = test(OsmUtils.createPrimitive("relation waterway=river"));
         assertEquals(1, errors.size());
         assertEquals(TagChecker.INVALID_PRESETS_TYPE, errors.get(0).getCode());
         errors = test(OsmUtils.createPrimitive("relation type=waterway waterway=river"));
-        assertTrue(errors.toString(), errors.isEmpty());
+        assertTrue(errors.isEmpty(), errors::toString);
     }
 
     /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/19519">Bug #19519</a>.
-     */
-    @Test
-    @Ignore("broken, see #19519")
-    public void testTicket19519() throws IOException {
+     * @throws IOException ignored
+     */
+    @Test
+    @Disabled("broken, see #19519")
+    void testTicket19519() throws IOException {
         List<TestError> errors = test(OsmUtils.createPrimitive("node amenity=restaurant cuisine=bavarian;beef_bowl"));
         assertEquals(0, errors.size());
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TurnRestrictionTestTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -11,5 +11,5 @@
  * JUnit Test of turn restriction validation test.
  */
-public class TurnRestrictionTestTest {
+class TurnRestrictionTestTest {
 
     private static final TurnrestrictionTest TURNRESTRICTION_TEST = new TurnrestrictionTest();
@@ -19,5 +19,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testTurnrestrictionFile() throws Exception {
+    void testTurnrestrictionFile() throws Exception {
         ValidatorTestUtils.testSampleFile("nodist/data/restriction.osm",
                 ds -> ds.getRelations(),
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnclosedWaysTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnclosedWaysTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnclosedWaysTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -26,10 +26,10 @@
  * JUnit Test of unclosed ways validation test.
  */
-public class UnclosedWaysTest {
+class UnclosedWaysTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets();
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testTicket10469() throws Exception {
+    void testTicket10469() throws Exception {
         UnclosedWays uwTest = new UnclosedWays();
         uwTest.initialize();
@@ -84,5 +84,5 @@
      */
     @Test
-    public void testWayInMultiPolygon() throws Exception {
+    void testWayInMultiPolygon() throws Exception {
         UnclosedWays uwTest = new UnclosedWays();
         uwTest.initialize();
@@ -108,5 +108,5 @@
      */
     @Test
-    public void testWayInBoundary() throws Exception {
+    void testWayInBoundary() throws Exception {
         UnclosedWays uwTest = new UnclosedWays();
         uwTest.initialize();
@@ -132,5 +132,5 @@
      */
     @Test
-    public void testAmenity() throws Exception {
+    void testAmenity() throws Exception {
         UnclosedWays uwTest = new UnclosedWays();
         uwTest.initialize();
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java	(revision 17275)
@@ -12,6 +12,6 @@
 import java.nio.file.Paths;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
@@ -26,5 +26,5 @@
  * Unit tests of {@code UnconnectedWays} class.
  */
-public class UnconnectedWaysTest {
+class UnconnectedWaysTest {
 
     private UnconnectedWays bib;
@@ -34,5 +34,5 @@
      * @throws Exception if the test cannot be initialized
      */
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         bib = new UnconnectedWays.UnconnectedHighways();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testTicket6313() throws IOException, IllegalDataException, FileNotFoundException {
+    void testTicket6313() throws IOException, IllegalDataException, FileNotFoundException {
         try (InputStream fis = Files.newInputStream(Paths.get("nodist/data/UnconnectedWaysTest.osm"))) {
             final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
@@ -67,5 +67,5 @@
      */
     @Test
-    public void testTicket18051() throws IOException, IllegalDataException, FileNotFoundException {
+    void testTicket18051() throws IOException, IllegalDataException, FileNotFoundException {
         try (InputStream fis = TestUtils.getRegressionDataStream(18051, "modified-ways.osm.bz2")) {
             final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
@@ -87,5 +87,5 @@
      */
     @Test
-    public void testTicket18106() throws IOException, IllegalDataException, FileNotFoundException {
+    void testTicket18106() throws IOException, IllegalDataException, FileNotFoundException {
         try (InputStream fis = TestUtils.getRegressionDataStream(18106, "uncon3.osm")) {
             final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
@@ -107,5 +107,5 @@
      */
     @Test
-    public void testTicket18137() throws IOException, IllegalDataException, FileNotFoundException {
+    void testTicket18137() throws IOException, IllegalDataException, FileNotFoundException {
         try (InputStream fis = TestUtils.getRegressionDataStream(18137, "18137_npe.osm")) {
             final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
@@ -127,5 +127,5 @@
      */
     @Test
-    public void testTicket19568() throws IOException, IllegalDataException, FileNotFoundException {
+    void testTicket19568() throws IOException, IllegalDataException, FileNotFoundException {
         try (InputStream fis = TestUtils.getRegressionDataStream(19568, "data.osm")) {
             final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UntaggedNodeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UntaggedNodeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UntaggedNodeTest.java	(revision 17275)
@@ -8,6 +8,6 @@
 import java.io.InputStream;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -21,5 +21,5 @@
  * Unit tests of {@code UntaggedNode} class.
  */
-public class UntaggedNodeTest {
+class UntaggedNodeTest {
 
     private final UntaggedNode test = new UntaggedNode();
@@ -28,5 +28,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules();
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testTicket12436() throws Exception {
+    void testTicket12436() throws Exception {
         test.initialize();
         test.startTest(null);
@@ -53,5 +53,5 @@
      */
     @Test
-    public void testTicket12464() throws Exception {
+    void testTicket12464() throws Exception {
         test.initialize();
         test.startTest(null);
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ValidatorTestUtils.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ValidatorTestUtils.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ValidatorTestUtils.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.data.validation.tests;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.InputStream;
@@ -27,5 +27,5 @@
  * Utilities for validator unit tests.
  */
-public final class ValidatorTestUtils {
+final class ValidatorTestUtils {
 
     private ValidatorTestUtils() {
@@ -58,10 +58,10 @@
                     for (TestError error : errors) {
                         Integer code = error.getCode();
-                        assertTrue(name + " does not expect JOSM error code " + code + ": " + error.getDescription(),
-                                expectedCodes.contains(code));
+                        assertTrue(expectedCodes.contains(code),
+                                name + " does not expect JOSM error code " + code + ": " + error.getDescription());
                         actualCodes.add(code);
                     }
-                    assertEquals(name + " " + expectedCodes + " => " + actualCodes,
-                            expectedCodes.size(), actualCodes.size());
+                    assertEquals(expectedCodes.size(), actualCodes.size(),
+                            name + " " + expectedCodes + " => " + actualCodes);
                 } else if (t.hasKey("name") && namePredicate != null && namePredicate.test(t.getName())) {
                     fail(name + " lacks josm_error_codes tag");
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/util/EntitiesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/util/EntitiesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/util/EntitiesTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.validation.util;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -12,10 +12,10 @@
  * Unit tests for class {@link Entities}.
  */
-public class EntitiesTest {
+class EntitiesTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(Entities.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/util/MultipleNameVisitorTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.data.validation.util;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Way;
@@ -17,10 +17,10 @@
  * Unit tests for class {@link MultipleNameVisitor}.
  */
-public class MultipleNameVisitorTest {
+class MultipleNameVisitorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testTicket11967() {
+    void testTicket11967() {
         MultipleNameVisitor visitor = new MultipleNameVisitor();
         visitor.visit(Arrays.asList(new Way(), new Way()));
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testTicket16652() {
+    void testTicket16652() {
         MultipleNameVisitor visitor = new MultipleNameVisitor();
         visitor.visit(Arrays.asList(
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/util/ValUtilTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/util/ValUtilTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/util/ValUtilTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.data.validation.util;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -12,10 +12,10 @@
  * Unit tests for class {@link ValUtil}.
  */
-public class ValUtilTest {
+class ValUtilTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(ValUtil.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/ConditionalOptionPaneUtilTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/ConditionalOptionPaneUtilTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/ConditionalOptionPaneUtilTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -12,10 +12,10 @@
  * Unit tests of {@link ConditionalOptionPaneUtil} class.
  */
-public class ConditionalOptionPaneUtilTest {
+class ConditionalOptionPaneUtilTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(ConditionalOptionPaneUtil.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/ExceptionDialogUtilTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/ExceptionDialogUtilTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/ExceptionDialogUtilTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -12,10 +12,10 @@
  * Unit tests of {@link ExceptionDialogUtil} class.
  */
-public class ExceptionDialogUtilTest {
+class ExceptionDialogUtilTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(ExceptionDialogUtil.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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.Assume.assumeFalse;
 
@@ -27,6 +27,6 @@
 import javax.swing.UIManager;
 
-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.TestUtils;
 import org.openstreetmap.josm.actions.JosmAction;
@@ -58,5 +58,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection().https().devAPI().timeout(20000);
@@ -133,5 +133,5 @@
      */
     @Test
-    public void testShowVersion() throws Exception {
+    void testShowVersion() throws Exception {
         testShow("--version", Version.getInstance().getAgentString());
     }
@@ -142,5 +142,5 @@
      */
     @Test
-    public void testShowHelp() throws Exception {
+    void testShowHelp() throws Exception {
         testShow("--help", MainApplication.getHelp().trim());
     }
@@ -150,5 +150,5 @@
      */
     @Test
-    public void testParamType() {
+    void testParamType() {
         assertEquals(DownloadParamType.bounds, DownloadParamType.paramType("48.000,16.000,48.001,16.001"));
         assertEquals(DownloadParamType.fileName, DownloadParamType.paramType("data.osm"));
@@ -164,5 +164,5 @@
      */
     @Test
-    public void testUpdateAndLoadPlugins() throws PluginListParseException {
+    void testUpdateAndLoadPlugins() throws PluginListParseException {
         final String old = System.getProperty("josm.plugins");
         try {
@@ -196,5 +196,5 @@
      */
     @Test
-    public void testSetupUIManager() {
+    void testSetupUIManager() {
         assumeFalse(PlatformManager.isPlatformWindows() && "True".equals(System.getenv("APPVEYOR")));
         MainApplication.setupUIManager();
@@ -212,5 +212,5 @@
      */
     @Test
-    public void testPostConstructorProcessCmdLineEmpty() {
+    void testPostConstructorProcessCmdLineEmpty() {
         // Check the method accepts no arguments
         MainApplication.postConstructorProcessCmdLine(new ProgramArguments(new String[0]));
@@ -245,5 +245,5 @@
      */
     @Test
-    public void testPostConstructorProcessCmdLineBounds() {
+    void testPostConstructorProcessCmdLineBounds() {
         doTestPostConstructorProcessCmdLine(
                 "-47.20,-126.75,-47.10,-126.65",
@@ -256,5 +256,5 @@
      */
     @Test
-    public void testPostConstructorProcessCmdLineHttpUrl() {
+    void testPostConstructorProcessCmdLineHttpUrl() {
         doTestPostConstructorProcessCmdLine(
                 "https://api06.dev.openstreetmap.org/api/0.6/map?bbox=-126.75,-47.20,-126.65,-47.10",
@@ -267,5 +267,5 @@
      */
     @Test
-    public void testPostConstructorProcessCmdLineFileUrl() throws MalformedURLException {
+    void testPostConstructorProcessCmdLineFileUrl() throws MalformedURLException {
         doTestPostConstructorProcessCmdLine(
                 Paths.get(TestUtils.getTestDataRoot() + "multipolygon.osm").toUri().toURL().toExternalForm(),
@@ -278,5 +278,5 @@
      */
     @Test
-    public void testPostConstructorProcessCmdLineFilename() throws MalformedURLException {
+    void testPostConstructorProcessCmdLineFilename() throws MalformedURLException {
         doTestPostConstructorProcessCmdLine(
                 Paths.get(TestUtils.getTestDataRoot() + "multipolygon.osm").toFile().getAbsolutePath(),
@@ -288,5 +288,5 @@
      */
     @Test
-    public void testGetRegisteredActionShortcut() {
+    void testGetRegisteredActionShortcut() {
         Shortcut noKeystroke = Shortcut.registerShortcut("no", "keystroke", 0, 0);
         assertNull(noKeystroke.getKeyStroke());
@@ -303,5 +303,5 @@
      */
     @Test
-    public void testMapFrameListener() {
+    void testMapFrameListener() {
         MapFrameListener listener = (o, n) -> { };
         assertTrue(MainApplication.addMapFrameListener(listener));
@@ -315,5 +315,5 @@
      */
     @Test
-    public void testEnumDownloadParamType() {
+    void testEnumDownloadParamType() {
         TestUtils.superficialEnumCodeCoverage(DownloadParamType.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.awt.Color;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -21,10 +21,10 @@
  * Unit tests of {@link MapScaler} class.
  */
-public class MapScalerTest {
+class MapScalerTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testMapScaler() {
+    void testMapScaler() {
         MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));
         assertEquals(Color.WHITE, MapScaler.getColor());
Index: trunk/test/unit/org/openstreetmap/josm/gui/MapStatusTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/MapStatusTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/MapStatusTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,10 +13,10 @@
  * Test {@link MapStatus}
  */
-public class MapStatusTest {
+class MapStatusTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(MapStatus.StatusTextHistory.class)
Index: trunk/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.awt.geom.AffineTransform;
@@ -9,7 +9,7 @@
 import java.util.function.Function;
 
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+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;
@@ -23,5 +23,5 @@
  * @author Michael Zangl
  */
-public class MapViewStateTest {
+class MapViewStateTest {
 
     private static final int WIDTH = 301;
@@ -32,5 +32,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -40,5 +40,5 @@
      * Create the default state.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         state = MapViewState.createDefaultState(WIDTH, HEIGHT);
@@ -56,6 +56,6 @@
 
         center = getter.apply(newState);
-        assertEquals("east", 3, center.getEastNorth().east(), 0.01);
-        assertEquals("north", 4, center.getEastNorth().north(), 0.01);
+        assertEquals(3, center.getEastNorth().east(), 0.01, "east");
+        assertEquals(4, center.getEastNorth().north(), 0.01, "north");
     }
 
@@ -64,13 +64,13 @@
      */
     @Test
-    public void testGetCenter() {
+    void testGetCenter() {
         doTestGetCenter(s -> s.getCenter(), t -> t / 2d);
     }
 
     private static void assertHasViewCoords(double x, double y, MapViewPoint center) {
-        assertEquals("x", x, center.getInViewX(), 0.01);
-        assertEquals("y", y, center.getInViewY(), 0.01);
-        assertEquals("x", x, center.getInView().getX(), 0.01);
-        assertEquals("y", y, center.getInView().getY(), 0.01);
+        assertEquals(x, center.getInViewX(), 0.01, "x");
+        assertEquals(y, center.getInViewY(), 0.01, "y");
+        assertEquals(x, center.getInView().getX(), 0.01, "x");
+        assertEquals(y, center.getInView().getY(), 0.01, "y");
     }
 
@@ -79,5 +79,5 @@
      */
     @Test
-    public void testGetForView() {
+    void testGetForView() {
         MapViewPoint corner = state.getForView(0, 0);
         assertHasViewCoords(0, 0, corner);
@@ -97,5 +97,5 @@
      */
     @Test
-    public void testGetViewSize() {
+    void testGetViewSize() {
         assertEquals(WIDTH, state.getViewWidth(), 0.01);
         assertEquals(HEIGHT, state.getViewHeight(), 0.01);
@@ -106,5 +106,5 @@
      */
     @Test
-    public void testPointConversions() {
+    void testPointConversions() {
         MapViewPoint p = state.getForView(WIDTH / 2d, HEIGHT / 2d);
         assertHasViewCoords(WIDTH / 2d, HEIGHT / 2d, p);
@@ -113,16 +113,16 @@
         LatLon shouldLatLon = ProjectionRegistry.getProjection().getWorldBoundsLatLon().getCenter();
         EastNorth shouldEastNorth = ProjectionRegistry.getProjection().latlon2eastNorth(shouldLatLon);
-        assertEquals("east", shouldEastNorth.east(), eastnorth.east(), 0.01);
-        assertEquals("north", shouldEastNorth.north(), eastnorth.north(), 0.01);
+        assertEquals(shouldEastNorth.east(), eastnorth.east(), 0.01, "east");
+        assertEquals(shouldEastNorth.north(), eastnorth.north(), 0.01, "north");
         MapViewPoint reversed = state.getPointFor(shouldEastNorth);
         assertHasViewCoords(WIDTH / 2d, HEIGHT / 2d, reversed);
 
         LatLon latlon = p.getLatLon();
-        assertEquals("lat", shouldLatLon.lat(), latlon.lat(), 0.01);
-        assertEquals("lon", shouldLatLon.lon(), latlon.lon(), 0.01);
+        assertEquals(shouldLatLon.lat(), latlon.lat(), 0.01, "lat");
+        assertEquals(shouldLatLon.lon(), latlon.lon(), 0.01, "lon");
 
         MapViewPoint p2 = state.getPointFor(new EastNorth(2, 3));
-        assertEquals("east", 2, p2.getEastNorth().east(), 0.01);
-        assertEquals("north", 3, p2.getEastNorth().north(), 0.01);
+        assertEquals(2, p2.getEastNorth().east(), 0.01, "east");
+        assertEquals(3, p2.getEastNorth().north(), 0.01, "north");
     }
 
@@ -131,5 +131,5 @@
      */
     @Test
-    public void testGetAffineTransform() {
+    void testGetAffineTransform() {
         for (EastNorth en : Arrays.asList(new EastNorth(100, 100), new EastNorth(0, 0), new EastNorth(300, 200),
                 new EastNorth(-1, -2.5))) {
@@ -138,6 +138,6 @@
             Point2D result = transform.transform(new Point2D.Double(en.getX(), en.getY()), null);
 
-            assertEquals("x", should.getInViewX(), result.getX(), 0.01);
-            assertEquals("y", should.getInViewY(), result.getY(), 0.01);
+            assertEquals(should.getInViewX(), result.getX(), 0.01, "x");
+            assertEquals(should.getInViewY(), result.getY(), 0.01, "y");
         }
     }
@@ -147,5 +147,5 @@
      */
     @Test
-    public void testOutsideFlags() {
+    void testOutsideFlags() {
         assertEquals(1, Integer.bitCount(MapViewState.OUTSIDE_BOTTOM));
         assertEquals(1, Integer.bitCount(MapViewState.OUTSIDE_TOP));
@@ -160,5 +160,5 @@
      */
     @Test
-    public void testPointGetOutsideRectangleFlags() {
+    void testPointGetOutsideRectangleFlags() {
         MapViewRectangle rect = state.getForView(0, 0).rectTo(state.getForView(10, 10));
         assertEquals(0, state.getForView(1, 1).getOutsideRectangleFlags(rect));
@@ -190,5 +190,5 @@
      */
     @Test
-    public void testPointOneNormInView() {
+    void testPointOneNormInView() {
         MapViewPoint p = state.getForView(5, 15);
         assertEquals(0, p.oneNormInView(p), 1e-10);
@@ -203,5 +203,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("MapViewViewPoint [x=1.0, y=2.0]",
                 state.getForView(1, 2).toString());
Index: trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 17275)
@@ -3,5 +3,5 @@
 
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.awt.Point;
@@ -15,7 +15,7 @@
 import org.hamcrest.CustomTypeSafeMatcher;
 import org.hamcrest.Matcher;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -33,5 +33,5 @@
  *
  */
-public class NavigatableComponentTest {
+class NavigatableComponentTest {
 
     private static final class NavigatableComponentMock extends NavigatableComponent {
@@ -54,5 +54,5 @@
      * We need the projection for coordinate conversions.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
@@ -61,5 +61,5 @@
      * Create a new, fresh {@link NavigatableComponent}
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         component = new NavigatableComponentMock();
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testDefaultScale() {
+    void testDefaultScale() {
         assertEquals(ProjectionRegistry.getProjection().getDefaultZoomInPPD(), component.getScale(), 0.00001);
     }
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testPoint2DEastNorth() {
+    void testPoint2DEastNorth() {
         assertThat(component.getPoint2D((EastNorth) null), CustomMatchers.is(new Point2D.Double()));
         Point2D shouldBeCenter = component.getPoint2D(component.getCenter());
@@ -103,5 +103,5 @@
      */
     @Test
-    public void testPoint2DLatLon() {
+    void testPoint2DLatLon() {
         assertThat(component.getPoint2D((LatLon) null), CustomMatchers.is(new Point2D.Double()));
         // TODO: Really test this.
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testZoomToLatLon() {
+    void testZoomToLatLon() {
         component.zoomTo(new LatLon(10, 10));
         Point2D shouldBeCenter = component.getPoint2D(new LatLon(10, 10));
@@ -124,5 +124,5 @@
      */
     @Test
-    public void testZoomToFactor() {
+    void testZoomToFactor() {
         EastNorth center = component.getCenter();
         double initialScale = component.getScale();
@@ -150,5 +150,5 @@
      */
     @Test
-    public void testGetEastNorth() {
+    void testGetEastNorth() {
         EastNorth center = component.getCenter();
         assertThat(component.getEastNorth(WIDTH / 2, HEIGHT / 2), CustomMatchers.is(center));
@@ -162,5 +162,5 @@
      */
     @Test
-    public void testZoomToFactorCenter() {
+    void testZoomToFactorCenter() {
         // zoomToFactor(double, double, double)
         // assumes getEastNorth works as expected
@@ -189,5 +189,5 @@
      */
     @Test
-    public void testGetProjectionBounds() {
+    void testGetProjectionBounds() {
         ProjectionBounds bounds = component.getProjectionBounds();
         assertThat(bounds.getCenter(), CustomMatchers.is(component.getCenter()));
@@ -201,5 +201,5 @@
      */
     @Test
-    public void testGetRealBounds() {
+    void testGetRealBounds() {
         Bounds bounds = component.getRealBounds();
         assertThat(bounds.getCenter(), CustomMatchers.is(component.getLatLon(WIDTH / 2, HEIGHT / 2)));
Index: trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.text.DecimalFormat;
@@ -8,6 +8,6 @@
 import java.util.Locale;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.SystemOfMeasurement;
@@ -16,10 +16,10 @@
  * Unit tests of {@link SystemOfMeasurement} class.
  */
-public class SystemOfMeasurementTest {
+class SystemOfMeasurementTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testGetDistText() {
+    void testGetDistText() {
 
         assertEquals("< 0.01 m", SystemOfMeasurement.METRIC.getDistText(-1));
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testGetDistTextLocalized() {
+    void testGetDistTextLocalized() {
         final DecimalFormat format = new DecimalFormat("0.000", DecimalFormatSymbols.getInstance(Locale.GERMAN));
         assertEquals("0,001 m", SystemOfMeasurement.METRIC.getDistText(0.001, format, 1e-6));
@@ -84,5 +84,5 @@
      */
     @Test
-    public void testGetAreaText() {
+    void testGetAreaText() {
         assertEquals("< 0.01 m²", SystemOfMeasurement.METRIC.getAreaText(-1));
         assertEquals("< 0.01 m²", SystemOfMeasurement.METRIC.getAreaText(-0.99));
Index: trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.lang.reflect.Constructor;
@@ -15,6 +15,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -40,5 +40,5 @@
  * @see <a href="https://josm.openstreetmap.de/ticket/6301">#6301</a>
  */
-public class TableCellRendererTest {
+class TableCellRendererTest {
 
     // list of classes that cannot be easily tested and are verified either manually or another unit tests
@@ -51,5 +51,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -62,5 +62,5 @@
      */
     @Test
-    public void testTableCellRenderer() throws ReflectiveOperationException {
+    void testTableCellRenderer() throws ReflectiveOperationException {
         Set<Class<? extends TableCellRenderer>> renderers = TestUtils.getJosmSubtypes(TableCellRenderer.class);
         Assert.assertTrue(renderers.size() >= 10); // if it finds less than 10 classes, something is broken
Index: trunk/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.autofilter;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.NoSuchElementException;
@@ -9,6 +9,6 @@
 import java.util.stream.IntStream;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
@@ -20,10 +20,10 @@
  * Unit tests of {@link AutoFilterRule} class.
  */
-public class AutoFilterRuleTest {
+class AutoFilterRuleTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().i18n();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testTagValuesForPrimitive() {
+    void testTagValuesForPrimitive() {
         // #17109, support values like 0.5 or 1.5 - level values are multiplied by 2 when parsing, values are divided by 2 for formatting
         final AutoFilterRule level = AutoFilterRule.getDefaultRule("level").orElseThrow(NoSuchElementException::new);
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testTagValuesForPrimitiveInclineUnit() {
+    void testTagValuesForPrimitiveInclineUnit() {
         final AutoFilterRule incline = AutoFilterRule.getDefaultRule("incline").orElseThrow(NoSuchElementException::new);
         assertTagValuesForPrimitive(incline, "way incline=up");
@@ -63,5 +63,5 @@
      */
     @Test
-    public void testTagValuesForPrimitivesDefaults() {
+    void testTagValuesForPrimitivesDefaults() {
         final AutoFilterRule layer = AutoFilterRule.getDefaultRule("layer").orElseThrow(NoSuchElementException::new);
         assertTagValuesForPrimitive(layer, "way foo=bar");
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testValueFormatter() {
+    void testValueFormatter() {
         final AutoFilterRule voltage = AutoFilterRule.getDefaultRule("voltage").orElseThrow(NoSuchElementException::new);
         assertEquals("230V", voltage.formatValue(230));
Index: trunk/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.bbox;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.bbox.SizeButton.AccessibleSizeButton;
@@ -17,10 +17,10 @@
  * Unit tests of {@link SizeButton} class.
  */
-public class SizeButtonTest {
+class SizeButtonTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testSizeButton() {
+    void testSizeButton() {
         SizeButton sb = new SizeButton(new SlippyMapBBoxChooser());
         sb.paint(TestUtils.newGraphics());
Index: trunk/test/unit/org/openstreetmap/josm/gui/bugreport/BugReportSettingsPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/bugreport/BugReportSettingsPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/bugreport/BugReportSettingsPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.bugreport;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.bugreport.BugReport;
@@ -14,10 +14,10 @@
  * Tests the {@link BugReportSettingsPanel} class.
  */
-public class BugReportSettingsPanelTest {
+class BugReportSettingsPanelTest {
 
     /**
      * Setup test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testBugReportSettingsPanel() {
+    void testBugReportSettingsPanel() {
         assertNotNull(new BugReportSettingsPanel(new BugReport(BugReport.intercept(new Exception()))));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/bugreport/DebugTextDisplayTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/bugreport/DebugTextDisplayTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/bugreport/DebugTextDisplayTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.bugreport;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,9 +14,9 @@
  * Unit test of {@link DebugTextDisplay} class.
  */
-public class DebugTextDisplayTest {
+class DebugTextDisplayTest {
     /**
      * Setup test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testGetCodeText() {
+    void testGetCodeText() {
         assertEquals("test", new DebugTextDisplay("test").getCodeText());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testCopyToClipboard() {
+    void testCopyToClipboard() {
         new DebugTextDisplay("copy").copyToClipboard();
         assertEquals(String.format("{{{%ncopy%n}}}"), ClipboardUtils.getClipboardStringContent());
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/ConflictResolverTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/ConflictResolverTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/ConflictResolverTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.conflict.pair;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.NoSuchElementException;
 
-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.SequenceCommand;
 import org.openstreetmap.josm.data.conflict.Conflict;
@@ -23,10 +23,10 @@
  * Unit tests of {@link ConflictResolver} class.
  */
-public class ConflictResolverTest {
+class ConflictResolverTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -35,7 +35,7 @@
      * Unit test of {@link ConflictResolver#buildResolveCommand} - empty case.
      */
-    @Test(expected = NoSuchElementException.class)
-    public void testBuildResolveCommandEmpty() {
-        assertNotNull(new ConflictResolver().buildResolveCommand());
+    @Test
+    void testBuildResolveCommandEmpty() {
+        assertThrows(NoSuchElementException.class, () -> new ConflictResolver().buildResolveCommand());
     }
 
@@ -44,5 +44,5 @@
      */
     @Test
-    public void testBuildResolveCommandNode() {
+    void testBuildResolveCommandNode() {
         ConflictResolver resolver = new ConflictResolver();
         Node n1 = new Node(LatLon.SOUTH_POLE);
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testBuildResolveCommandWay() {
+    void testBuildResolveCommandWay() {
         ConflictResolver resolver = new ConflictResolver();
         Way w1 = new Way();
@@ -76,5 +76,5 @@
      */
     @Test
-    public void testBuildResolveCommandRelation() {
+    void testBuildResolveCommandRelation() {
         ConflictResolver resolver = new ConflictResolver();
         Relation r1 = new Relation();
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.conflict.pair.nodes;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.beans.PropertyChangeEvent;
@@ -19,6 +19,6 @@
 import javax.swing.DefaultListSelectionModel;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.osm.Node;
@@ -34,5 +34,5 @@
  * Unit tests of {@link NodeListMergeModel}.
  */
-public class NodeListMergeModelTest {
+class NodeListMergeModelTest {
 
     private final DatasetFactory my = new DatasetFactory();
@@ -42,5 +42,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -79,5 +79,5 @@
             if (idx[i] instanceof Integer) {
                 int j = (Integer) idx[i];
-                assertTrue("expected row " + j + " to be selected", model.isSelectedIndex(j));
+                assertTrue(model.isSelectedIndex(j), "expected row " + j + " to be selected");
                 break;
             }
@@ -90,5 +90,5 @@
             }
             for (int j = rows[0]; j <= rows[1]; j++) {
-                assertTrue("expected row " + j + " to be selected", model.isSelectedIndex(j));
+                assertTrue(model.isSelectedIndex(j), "expected row " + j + " to be selected");
             }
         }
@@ -96,5 +96,5 @@
 
     @Test
-    public void testCopyMyNodesToTop1() {
+    void testCopyMyNodesToTop1() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -118,5 +118,5 @@
 
     @Test
-    public void testCopyMyNodesToTop2() {
+    void testCopyMyNodesToTop2() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -144,5 +144,5 @@
 
     @Test
-    public void testCopyMyNodesToTop3() {
+    void testCopyMyNodesToTop3() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -170,5 +170,5 @@
 
     @Test
-    public void testCopyMyNodesToTop4() {
+    void testCopyMyNodesToTop4() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -197,5 +197,5 @@
 
     @Test
-    public void testCopyMyNodesToEnd1() {
+    void testCopyMyNodesToEnd1() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -218,5 +218,5 @@
 
     @Test
-    public void testCopyMyNodesToEnd2() {
+    void testCopyMyNodesToEnd2() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -243,5 +243,5 @@
 
     @Test
-    public void testCopyMyNodesToEnd3() {
+    void testCopyMyNodesToEnd3() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -270,5 +270,5 @@
 
     @Test
-    public void testCopyMyNodesToEnd4() {
+    void testCopyMyNodesToEnd4() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -303,5 +303,5 @@
 
     @Test
-    public void testCopyMyNodesBeforeCurrent1() {
+    void testCopyMyNodesBeforeCurrent1() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -330,5 +330,5 @@
 
     @Test
-    public void testCopyMyNodesBeforeCurrent2() {
+    void testCopyMyNodesBeforeCurrent2() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -358,5 +358,5 @@
 
     @Test
-    public void testCopyMyNodesBeforeCurrent3() {
+    void testCopyMyNodesBeforeCurrent3() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -393,5 +393,5 @@
     /* ----------------------------------------------------------------------------- */
     @Test
-    public void testCopyMyNodesAfterCurrent1() {
+    void testCopyMyNodesAfterCurrent1() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -420,5 +420,5 @@
 
     @Test
-    public void testCopyMyNodesAfterCurrent2() {
+    void testCopyMyNodesAfterCurrent2() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -449,5 +449,5 @@
 
     @Test
-    public void testCopyMyNodesAfterCurrent3() {
+    void testCopyMyNodesAfterCurrent3() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -482,5 +482,5 @@
     /* ----------------------------------------------------------------------------- */
     @Test
-    public void testMoveUpMergedNodes1() {
+    void testMoveUpMergedNodes1() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -508,5 +508,5 @@
 
     @Test
-    public void testMoveUpMergedNodes2() {
+    void testMoveUpMergedNodes2() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -538,5 +538,5 @@
 
     @Test
-    public void testMoveUpMergedNodes3() {
+    void testMoveUpMergedNodes3() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -571,5 +571,5 @@
     /* ----------------------------------------------------------------------------- */
     @Test
-    public void testMoveDownMergedNodes1() {
+    void testMoveDownMergedNodes1() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -597,5 +597,5 @@
 
     @Test
-    public void testMoveDownMergedNodes2() {
+    void testMoveDownMergedNodes2() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -627,5 +627,5 @@
 
     @Test
-    public void testMoveDownMergedNodes3() {
+    void testMoveDownMergedNodes3() {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -660,5 +660,5 @@
     /* ----------------------------------------------------------------------------- */
     @Test
-    public void testAddPropertyChangeListener() throws ReflectiveOperationException {
+    void testAddPropertyChangeListener() throws ReflectiveOperationException {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -675,5 +675,5 @@
 
     @Test
-    public void testRemovePropertyChangeListener() throws ReflectiveOperationException {
+    void testRemovePropertyChangeListener() throws ReflectiveOperationException {
         NodeListMergeModel model = new NodeListMergeModel();
 
@@ -693,5 +693,5 @@
     /* ----------------------------------------------------------------------------- */
     @Test
-    public void testSetFrozen() {
+    void testSetFrozen() {
         NodeListMergeModel model = new NodeListMergeModel();
         model.setFrozen(true);
@@ -703,5 +703,5 @@
 
     @Test
-    public void testSetFrozenWithPropertyChangeNotification() {
+    void testSetFrozenWithPropertyChangeNotification() {
         NodeListMergeModel model = new NodeListMergeModel();
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.conflict.pair.nodes;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link NodeListMerger} class.
  */
-public class NodeListMergerTest {
+class NodeListMergerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testNodeListMerger() {
+    void testNodeListMerger() {
         assertNotNull(new NodeListMerger());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModelTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.gui.conflict.pair.properties;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.conflict.Conflict;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -27,5 +27,5 @@
  * Unit tests of {@link PropertiesMergeModel}.
  */
-public class PropertiesMergeModelTest {
+class PropertiesMergeModelTest {
 
     private abstract static class TestChangeListener implements ChangeListener {
@@ -50,5 +50,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -57,5 +57,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         model = new PropertiesMergeModel();
@@ -67,5 +67,5 @@
 
     @Test
-    public void testPopulate() {
+    void testPopulate() {
         DataSet d1 = new DataSet();
         DataSet d2 = new DataSet();
@@ -90,5 +90,5 @@
 
     @Test
-    public void testDecidingAboutCoords() {
+    void testDecidingAboutCoords() {
         DataSet d1 = new DataSet();
         DataSet d2 = new DataSet();
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.conflict.pair.properties;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests of {@link PropertiesMerger} class.
  */
-public class PropertiesMergerTest {
+class PropertiesMergerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testPropertiesMerger() {
+    void testPropertiesMerger() {
         PropertiesMerger merger = new PropertiesMerger();
         assertNotNull(TestUtils.getComponentByName(merger, "button.keepmycoordinates"));
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMergerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMergerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMergerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.conflict.pair.relation;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link RelationMemberMerger} class.
  */
-public class RelationMemberMergerTest {
+class RelationMemberMergerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testRelationMemberMerger() {
+    void testRelationMemberMerger() {
         assertNotNull(new RelationMemberMerger());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditorTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.conflict.pair.relation;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+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 java.awt.Component;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.RelationMember;
@@ -19,10 +19,10 @@
  * Unit tests of {@link RelationMemberTableCellEditor} class.
  */
-public class RelationMemberTableCellEditorTest {
+class RelationMemberTableCellEditorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testRelationMemberTableCellEditor() {
+    void testRelationMemberTableCellEditor() {
         RelationMemberTableCellEditor editor = new RelationMemberTableCellEditor();
         assertNull(editor.getTableCellEditorComponent(null, null, false, 0, 0));
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRendererTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.conflict.pair.relation;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.JTable;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.RelationMember;
@@ -19,10 +19,10 @@
  * Unit tests of {@link RelationMemberTableCellRenderer} class.
  */
-public class RelationMemberTableCellRendererTest {
+class RelationMemberTableCellRendererTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testRelationMemberTableCellRenderer() {
+    void testRelationMemberTableCellRenderer() {
         JTable table = new JTable(new NodeListMergeModel().new EntriesTableModel(ListRole.MY_ENTRIES));
         RelationMember member = new RelationMember("foo", new Node());
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItemTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItemTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItemTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.conflict.pair.tags;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType;
@@ -18,15 +18,15 @@
  * Unit tests of {@link TagMergeItem} class.
  */
-public class TagMergeItemTest {
+class TagMergeItemTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
 
     @Test
-    public void testTagMergeItem() {
+    void testTagMergeItem() {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         assertEquals("key", item.getKey());
@@ -37,5 +37,5 @@
 
     @Test
-    public void testTagMergeItem2() {
+    void testTagMergeItem2() {
         Node n1 = new Node(1);
         Node n2 = new Node(1);
@@ -51,5 +51,5 @@
 
     @Test
-    public void testTagMergeItem3() {
+    void testTagMergeItem3() {
         Node n1 = new Node(1);
         Node n2 = new Node(1);
@@ -65,5 +65,5 @@
 
     @Test
-    public void testTagMergeItem4() {
+    void testTagMergeItem4() {
         Node n1 = new Node(1);
         Node n2 = new Node(1);
@@ -80,5 +80,5 @@
 
     @Test
-    public void testDecide() {
+    void testDecide() {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         item.decide(MergeDecisionType.KEEP_MINE);
@@ -87,5 +87,5 @@
 
     @Test
-    public void testDecide1() {
+    void testDecide1() {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         try {
@@ -99,5 +99,5 @@
 
     @Test
-    public void testApplyToMyPrimitive() {
+    void testApplyToMyPrimitive() {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         item.decide(MergeDecisionType.KEEP_MINE);
@@ -114,5 +114,5 @@
 
     @Test
-    public void testApplyToMyPrimitive2() {
+    void testApplyToMyPrimitive2() {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         item.decide(MergeDecisionType.KEEP_THEIR);
@@ -129,5 +129,5 @@
 
     @Test
-    public void testApplyToMyPrimitive3() {
+    void testApplyToMyPrimitive3() {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         // item is undecided
@@ -146,5 +146,5 @@
 
     @Test
-    public void testApplyToMyPrimitive4() {
+    void testApplyToMyPrimitive4() {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModelTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.conflict.pair.tags;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.beans.PropertyChangeListener;
@@ -9,6 +9,6 @@
 import java.util.Set;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Node;
@@ -22,10 +22,10 @@
  */
 @SuppressWarnings("unchecked")
-public class TagMergeModelTest {
+class TagMergeModelTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -40,5 +40,5 @@
 
     @Test
-    public void testAddPropertyChangeListener() throws ReflectiveOperationException {
+    void testAddPropertyChangeListener() throws ReflectiveOperationException {
         TagMergeModel model = new TagMergeModel();
         PropertyChangeListener listener = evt -> {
@@ -53,5 +53,5 @@
 
     @Test
-    public void testRemovePropertyChangeListener() throws ReflectiveOperationException {
+    void testRemovePropertyChangeListener() throws ReflectiveOperationException {
         TagMergeModel model = new TagMergeModel();
         PropertyChangeListener listener = evt -> {
@@ -66,5 +66,5 @@
 
     @Test
-    public void testPopulateNoConflichts() throws ReflectiveOperationException {
+    void testPopulateNoConflichts() throws ReflectiveOperationException {
         Node my = new Node(1);
         Node their = new Node(1);
@@ -78,5 +78,5 @@
 
     @Test
-    public void testPopulateNoConflicts1() throws ReflectiveOperationException {
+    void testPopulateNoConflicts1() throws ReflectiveOperationException {
         Node my = new Node(1);
         my.put("key", "value");
@@ -92,5 +92,5 @@
 
     @Test
-    public void testPopulateMissingKeyMine() throws ReflectiveOperationException {
+    void testPopulateMissingKeyMine() throws ReflectiveOperationException {
         Node my = new Node(1);
         Node their = new Node(1);
@@ -110,5 +110,5 @@
 
     @Test
-    public void testPopulateMissingKeyTheir() throws ReflectiveOperationException {
+    void testPopulateMissingKeyTheir() throws ReflectiveOperationException {
         Node my = new Node(1);
         my.put("key", "value");
@@ -128,5 +128,5 @@
 
     @Test
-    public void testPopulateConflictingValues() throws ReflectiveOperationException {
+    void testPopulateConflictingValues() throws ReflectiveOperationException {
         Node my = new Node(1);
         my.put("key", "myvalue");
@@ -147,5 +147,5 @@
 
     @Test
-    public void testAddItem() throws ReflectiveOperationException {
+    void testAddItem() throws ReflectiveOperationException {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         TagMergeModel model = new TagMergeModel();
@@ -163,5 +163,5 @@
 
     @Test
-    public void testDecide() throws ReflectiveOperationException {
+    void testDecide() throws ReflectiveOperationException {
         TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         TagMergeModel model = new TagMergeModel();
@@ -187,5 +187,5 @@
 
     @Test
-    public void testDecideMultiple() throws ReflectiveOperationException {
+    void testDecideMultiple() throws ReflectiveOperationException {
 
         TagMergeModel model = new TagMergeModel();
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.conflict.pair.tags;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link TagMerger} class.
  */
-public class TagMergerTest {
+class TagMergerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testTagMerger() {
+    void testTagMerger() {
         assertNotNull(new TagMerger());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditorTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.conflict.tags;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link MultiValueCellEditor} class.
  */
-public class MultiValueCellEditorTest {
+class MultiValueCellEditorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testMultiValueCellEditor() {
+    void testMultiValueCellEditor() {
         assertNotNull(new MultiValueCellEditor().getTableCellEditorComponent(null, new MultiValueResolutionDecision(), false, 0, 0));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRendererTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.conflict.tags;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.Arrays;
@@ -10,6 +10,6 @@
 import javax.swing.JTable;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.data.osm.TagCollection;
@@ -21,10 +21,10 @@
  * Unit tests of {@link MultiValueCellRenderer} class.
  */
-public class MultiValueCellRendererTest {
+class MultiValueCellRendererTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testMultiValueCellRenderer() {
+    void testMultiValueCellRenderer() {
         TagConflictResolverModel model = new TagConflictResolverModel();
         TagCollection tags = new TagCollection(Arrays.asList(new Tag("oneway", "yes"), new Tag("oneway", "no")));
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialogTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.conflict.tags;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.awt.Insets;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog.StatisticsInfo;
@@ -22,10 +22,10 @@
  * Unit tests of {@link PasteTagsConflictResolverDialog} class.
  */
-public class PasteTagsConflictResolverDialogTest {
+class PasteTagsConflictResolverDialogTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testPaneTitles() {
+    void testPaneTitles() {
         assertNotNull(PasteTagsConflictResolverDialog.PANE_TITLES);
         assertNotNull(PasteTagsConflictResolverDialog.PANE_TITLES.get(OsmPrimitiveType.NODE));
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testStatisticsInfoTable() {
+    void testStatisticsInfoTable() {
         StatisticsInfo info = new StatisticsInfo();
         StatisticsTableModel model = new StatisticsTableModel();
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModelTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.conflict.tags;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -10,6 +10,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -25,10 +25,10 @@
  * Unit tests of {@link RelationMemberConflictResolverModel} class.
  */
-public class RelationMemberConflictResolverModelTest {
+class RelationMemberConflictResolverModelTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -58,5 +58,5 @@
 
     @Test
-    public void testSameRoles() throws Exception {
+    void testSameRoles() throws Exception {
         final List<Way> ways = buildTestDataSet();
         final Relation r = new Relation();
@@ -76,5 +76,5 @@
 
     @Test
-    public void testDifferentRoles() throws Exception {
+    void testDifferentRoles() throws Exception {
         final List<Way> ways = buildTestDataSet();
         final Relation r = new Relation();
@@ -89,5 +89,5 @@
 
     @Test
-    public void testDifferentPresence() throws Exception {
+    void testDifferentPresence() throws Exception {
         final List<Way> ways = buildTestDataSet();
         final Relation r = new Relation();
@@ -101,5 +101,5 @@
 
     @Test
-    public void testEveryMemberIsPresentTwice() throws Exception {
+    void testEveryMemberIsPresentTwice() throws Exception {
         final List<Way> ways = buildTestDataSet();
         final Relation r = new Relation();
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.conflict.tags;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link RelationMemberConflictResolver} class.
  */
-public class RelationMemberConflictResolverTest {
+class RelationMemberConflictResolverTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testRelationMemberConflictResolver() {
+    void testRelationMemberConflictResolver() {
         assertNotNull(new RelationMemberConflictResolver(null));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.conflict.tags;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+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 java.util.Arrays;
@@ -11,8 +12,9 @@
 import java.util.HashSet;
 import java.util.List;
+import java.util.regex.PatternSyntaxException;
 import java.util.stream.Collectors;
 
-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.data.osm.Tag;
 import org.openstreetmap.josm.data.osm.TagCollection;
@@ -27,10 +29,10 @@
  * Unit tests of {@link TagConflictResolutionUtil} class.
  */
-public class TagConflictResolutionUtilTest {
+class TagConflictResolutionUtilTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -45,5 +47,5 @@
      */
     @Test
-    public void testApplyAutomaticTagConflictResolution() {
+    void testApplyAutomaticTagConflictResolution() {
         // Check that general tag conflict are not resolved
         TagCollection tc = new TagCollection();
@@ -106,5 +108,5 @@
      * Unit tests of {@link AutomaticCombine} class.
      */
-    public static class AutomaticCombineTest {
+    static class AutomaticCombineTest {
 
         /**
@@ -127,5 +129,5 @@
          * Setup test.
          */
-        @Rule
+        @RegisterExtension
         @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
         public JOSMTestRules test = new JOSMTestRules();
@@ -135,5 +137,5 @@
          */
         @Test
-        public void testMatchesKeyEmptyKey() {
+        void testMatchesKeyEmptyKey() {
             for (AutomaticCombine resolver: differentlyConstructed(new AutomaticCombine("", "random description", true, ";", null))) {
                 assertFalse(resolver.matchesKey("a"));
@@ -146,5 +148,5 @@
          */
         @Test
-        public void testMatchesKeyNotRegex() {
+        void testMatchesKeyNotRegex() {
             for (AutomaticCombine resolver: differentlyConstructed(new AutomaticCombine(
                     "keyname", "random description", false, "|", null))) {
@@ -161,5 +163,5 @@
          */
         @Test
-        public void testMatchesKeyRegex() {
+        void testMatchesKeyRegex() {
             for (AutomaticCombine resolver: differentlyConstructed(new AutomaticCombine("test[45].*", "", true, ";", "Integer"))) {
                 assertFalse(resolver.matchesKey("key"));
@@ -173,5 +175,5 @@
          */
         @Test
-        public void testInvalidRegex() {
+        void testInvalidRegex() {
             for (AutomaticCombine resolver: differentlyConstructed(new AutomaticCombine("invalidregex.(]", "", false, ";", null))) {
                 // Should not raise exception if the resolver.isRexEx == false:
@@ -188,20 +190,19 @@
          * Unit test of {@link AutomaticCombine} with invalid regex.
          */
-        @Test(expected = java.util.regex.PatternSyntaxException.class)
-        public void testInvalidRegexExceptionDefaultConstructed() {
+        @Test
+        void testInvalidRegexExceptionDefaultConstructed() {
             AutomaticCombine resolver = new AutomaticCombine("AB.(]", "", true, ";", null);
-            resolver.matchesKey("AB");
-        }
-
+            assertThrows(PatternSyntaxException.class, () -> resolver.matchesKey("AB"));
+        }
 
         /**
          * Unit test of {@link AutomaticCombine} with invalid regex.
          */
-        @Test(expected = java.util.regex.PatternSyntaxException.class)
-        public void testInvalidRegexExceptionFullyConstructed() {
+        @Test
+        void testInvalidRegexExceptionFullyConstructed() {
             AutomaticCombine resolver = new AutomaticCombine();
             resolver.key = "AB.(]";
             resolver.isRegex = true;
-            resolver.matchesKey("AB");
+            assertThrows(PatternSyntaxException.class, () -> resolver.matchesKey("AB"));
         }
 
@@ -210,5 +211,5 @@
          */
         @Test
-        public void testResolve() {
+        void testResolve() {
             for (AutomaticCombine resolver: differentlyConstructed(new AutomaticCombine("random", "", true, "|", "String"))) {
                 assertEquals(resolver.resolve(newHashSet("value1", "value2")), "value1|value2");
@@ -230,9 +231,9 @@
      * Unit tests of {@link AutomaticChoice} class.
      */
-    public static class AutomaticChoiceTest {
+    static class AutomaticChoiceTest {
         /**
          * Setup test.
          */
-        @Rule
+        @RegisterExtension
         @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
         public JOSMTestRules test = new JOSMTestRules();
@@ -260,5 +261,5 @@
          */
         @Test
-        public void testMatchesValue() {
+        void testMatchesValue() {
             for (AutomaticChoice resolver: differentlyConstructed(new AutomaticChoice(
                     "random key", "random group", "random description", false, ".*valueToMatch", "Score$0\\1"))) {
@@ -282,5 +283,5 @@
          */
         @Test
-        public void testComputeScoreFromValue() {
+        void testComputeScoreFromValue() {
             for (AutomaticChoice resolver: differentlyConstructed(new AutomaticChoice(
                     "random key", "random group", "random description", false, ".*valueToMatch", "Score$0\\1"))) {
@@ -298,5 +299,5 @@
          */
         @Test
-        public void testInvalidRegex() {
+        void testInvalidRegex() {
             for (AutomaticChoice resolver: differentlyConstructed(new AutomaticChoice(
                     "k", "g", "", false, "invalidregex.(]", "InvalidScore$0\\1$-4"))) {
@@ -316,8 +317,8 @@
          * Unit test of {@link AutomaticChoice} when invalid regex is used.
          */
-        @Test(expected = java.util.regex.PatternSyntaxException.class)
-        public void testMatchesValueInvalidRegex() {
+        @Test
+        void testMatchesValueInvalidRegex() {
             AutomaticChoice resolver = new AutomaticChoice("k", "g", "", true, "invalidregex.(]", "InvalidScore$0\\1$-4");
-            resolver.matchesValue("test");
+            assertThrows(PatternSyntaxException.class, () -> resolver.matchesValue("test"));
         }
 
@@ -325,10 +326,9 @@
          * Unit test of {@link AutomaticChoice} when invalid regex is used.
          */
-        @Test(expected = java.util.regex.PatternSyntaxException.class)
-        public void testComputeScoreFromValueInvalidRegex() {
+        @Test
+        void testComputeScoreFromValueInvalidRegex() {
             AutomaticChoice resolver = new AutomaticChoice("k", "g", "", true, "invalidregex.(]", "valid");
-            resolver.computeScoreFromValue("valid");
-        }
-
+            assertThrows(PatternSyntaxException.class, () -> resolver.computeScoreFromValue("valid"));
+        }
 
         /**
@@ -336,5 +336,5 @@
          */
         @Test
-        public void testComputeScoreFromValueInvalidReplacement() {
+        void testComputeScoreFromValueInvalidReplacement() {
             AutomaticChoice resolver = new AutomaticChoice("k", "g", "", true, "valid", "InvalidScore$0\\1$-4");
             boolean exceptionThrown = false;
@@ -351,9 +351,9 @@
      * Unit tests of {@link AutomaticChoiceGroup} class.
      */
-    public static class AutomaticChoiceGroupTest {
+    static class AutomaticChoiceGroupTest {
         /**
          * Setup test.
          */
-        @Rule
+        @RegisterExtension
         @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
         public JOSMTestRules test = new JOSMTestRules();
@@ -373,5 +373,5 @@
          */
         @Test
-        public void testGroupChoices() {
+        void testGroupChoices() {
             Collection<AutomaticChoiceGroup> groups = AutomaticChoiceGroup.groupChoices(Arrays.asList(choiceKey1Group1, choiceKey1Group2));
             assertEquals(2, groups.size());
@@ -405,5 +405,5 @@
          */
         @Test
-        public void testMatchesKey() {
+        void testMatchesKey() {
             AutomaticChoiceGroup group = new AutomaticChoiceGroup(
                     choiceKey1Group1.key, choiceKey1Group1.group, choiceKey1Group1.isRegex,
@@ -427,5 +427,5 @@
          */
         @Test
-        public void testResolve() {
+        void testResolve() {
             AutomaticChoiceGroup group = new AutomaticChoiceGroup(
                     choiceKey1Group1.key, choiceKey1Group1.group, choiceKey1Group1.isRegex,
Index: trunk/test/unit/org/openstreetmap/josm/gui/correction/RoleCorrectionTableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/correction/RoleCorrectionTableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/correction/RoleCorrectionTableTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.gui.correction;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.util.Arrays;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.correction.RoleCorrection;
 import org.openstreetmap.josm.data.osm.Node;
@@ -23,10 +23,10 @@
  * Unit tests of {@link RoleCorrectionTable} class.
  */
-public class RoleCorrectionTableTest {
+class RoleCorrectionTableTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testRoleCorrectionTable() {
+    void testRoleCorrectionTable() {
         Relation r = new Relation();
         RelationMember member = new RelationMember("foo", new Node());
Index: trunk/test/unit/org/openstreetmap/josm/gui/correction/TagCorrectionTableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/correction/TagCorrectionTableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/correction/TagCorrectionTableTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.gui.correction;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.util.Arrays;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.correction.TagCorrection;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -20,10 +20,10 @@
  * Unit tests of {@link TagCorrectionTable} class.
  */
-public class TagCorrectionTableTest {
+class TagCorrectionTableTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testTagCorrectionTable() {
+    void testTagCorrectionTable() {
         TagCorrection tc1 = new TagCorrection("foo", "bar", "foo", "baz");
         TagCorrection tc2 = new TagCorrection("bar", "foo", "baz", "foo");
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+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.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
@@ -17,6 +17,6 @@
 import java.io.IOException;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -28,5 +28,5 @@
  * @author Michael Zangl
  */
-public class ClipboardUtilsTest {
+class ClipboardUtilsTest {
     private static final class ThrowIllegalStateClipboard extends Clipboard {
         private int failingAccesses = 3;
@@ -70,5 +70,5 @@
      * No dependencies
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -78,5 +78,5 @@
      */
     @Test
-    public void testGetClipboard() {
+    void testGetClipboard() {
         Clipboard c = ClipboardUtils.getClipboard();
         assertNotNull(c);
@@ -88,5 +88,5 @@
      */
     @Test
-    public void testCopyPasteString() {
+    void testCopyPasteString() {
         ClipboardUtils.copyString("");
         assertEquals("", ClipboardUtils.getClipboardStringContent());
@@ -102,5 +102,5 @@
      */
     @Test
-    public void testGetContentIllegalState() {
+    void testGetContentIllegalState() {
         ThrowIllegalStateClipboard throwingClipboard = new ThrowIllegalStateClipboard("test");
 
@@ -118,5 +118,5 @@
      */
     @Test
-    public void testSystemSelectionDoesNotFail() {
+    void testSystemSelectionDoesNotFail() {
         assumeTrue(GraphicsEnvironment.isHeadless());
         assertNull(ClipboardUtils.getSystemSelection());
@@ -128,5 +128,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(ClipboardUtils.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/LayerTransferableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/LayerTransferableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/LayerTransferableTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.datatransfer.DataFlavor;
@@ -11,6 +12,6 @@
 import java.util.Arrays;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.datatransfer.LayerTransferable.Data;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -24,5 +25,5 @@
  * @since 10605
  */
-public class LayerTransferableTest {
+class LayerTransferableTest {
     private TestLayer layer1;
     private TestLayer layer2;
@@ -32,5 +33,5 @@
      * Set up test data
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         layer1 = new LayerManagerTest.TestLayer();
@@ -45,5 +46,5 @@
      */
     @Test
-    public void testLayerData() {
+    void testLayerData() {
         Data data = new Data(manager, Arrays.<Layer>asList(layer1, layer2));
 
@@ -59,5 +60,5 @@
      */
     @Test
-    public void testSupportedDataFlavor() {
+    void testSupportedDataFlavor() {
         LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2));
 
@@ -75,5 +76,5 @@
      */
     @Test
-    public void testTransferData() throws Exception {
+    void testTransferData() throws Exception {
         LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2));
 
@@ -88,11 +89,10 @@
     /**
      * Test {@link LayerTransferable#getTransferData(DataFlavor)} for unsupported {@link DataFlavor}
-     * @throws Exception if any error occurs
      */
-    @Test(expected = UnsupportedFlavorException.class)
-    public void testTransferDataUnsupported() throws Exception {
+    @Test
+    void testTransferDataUnsupported() {
         LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2));
 
-        transferable.getTransferData(DataFlavor.imageFlavor);
+        assertThrows(UnsupportedFlavorException.class, () -> transferable.getTransferData(DataFlavor.imageFlavor));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.actions.CopyAction;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -23,9 +23,9 @@
  * Unit tests of {@link OsmTransferHandler} class.
  */
-public class OsmTransferHandlerTest {
+class OsmTransferHandlerTest {
     /**
      * Prefs to use OSM primitives
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection().main();
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testPasteOn() {
+    void testPasteOn() {
         DataSet ds1 = new DataSet();
         Node n1 = new Node(new LatLon(43, 1));
@@ -63,5 +63,5 @@
      */
     @Test
-    public void testPasteTags() {
+    void testPasteTags() {
         Node n = new Node(LatLon.ZERO);
         MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(n), "testPasteTags", null));
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java	(revision 17275)
@@ -2,7 +2,8 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.datatransfer.DataFlavor;
@@ -13,6 +14,6 @@
 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.data.osm.Node;
 import org.openstreetmap.josm.data.osm.NodeData;
@@ -27,9 +28,9 @@
  * Unit tests of {@link PrimitiveTransferable} class.
  */
-public class PrimitiveTransferableTest {
+class PrimitiveTransferableTest {
     /**
      * Prefs to use OSM primitives
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -39,5 +40,5 @@
      */
     @Test
-    public void testGetTransferDataFlavors() {
+    void testGetTransferDataFlavors() {
         List<DataFlavor> flavors = Arrays.asList(new PrimitiveTransferable(null).getTransferDataFlavors());
         int ptd = flavors.indexOf(PrimitiveTransferData.DATA_FLAVOR);
@@ -57,5 +58,5 @@
      */
     @Test
-    public void testIsDataFlavorSupported() {
+    void testIsDataFlavorSupported() {
         assertTrue(new PrimitiveTransferable(null).isDataFlavorSupported(PrimitiveTransferData.DATA_FLAVOR));
         assertFalse(new PrimitiveTransferable(null).isDataFlavorSupported(DataFlavor.imageFlavor));
@@ -67,5 +68,5 @@
      */
     @Test
-    public void testGetTransferDataNominal() throws UnsupportedFlavorException {
+    void testGetTransferDataNominal() throws UnsupportedFlavorException {
         PrimitiveTransferData data = PrimitiveTransferData.getData(Collections.singleton(new Node(1)));
         PrimitiveTransferable pt = new PrimitiveTransferable(data);
@@ -83,10 +84,9 @@
     /**
      * Test of {@link PrimitiveTransferable#getTransferData} method - error case.
-     * @throws UnsupportedFlavorException always
      */
-    @Test(expected = UnsupportedFlavorException.class)
-    public void testGetTransferDataError() throws UnsupportedFlavorException {
+    @Test
+    void testGetTransferDataError() {
         PrimitiveTransferData data = PrimitiveTransferData.getData(Collections.singleton(new Node(1)));
-        new PrimitiveTransferable(data).getTransferData(DataFlavor.imageFlavor);
+        assertThrows(UnsupportedFlavorException.class, () -> new PrimitiveTransferable(data).getTransferData(DataFlavor.imageFlavor));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java	(revision 17275)
@@ -2,7 +2,8 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable.RELATION_MEMBER_DATA;
 
@@ -12,6 +13,6 @@
 import java.util.Collections;
 
-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.data.osm.Node;
 import org.openstreetmap.josm.data.osm.PrimitiveData;
@@ -26,10 +27,10 @@
  * Unit tests of {@link RelationMemberTransferable} class.
  */
-public class RelationMemberTransferableTest {
+class RelationMemberTransferableTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -39,5 +40,5 @@
      */
     @Test
-    public void testGetTransferDataFlavors() {
+    void testGetTransferDataFlavors() {
         DataFlavor[] flavors = new RelationMemberTransferable(Collections.<RelationMember>emptyList()).getTransferDataFlavors();
         assertEquals(3, flavors.length);
@@ -51,5 +52,5 @@
      */
     @Test
-    public void testIsDataFlavorSupported() {
+    void testIsDataFlavorSupported() {
         RelationMemberTransferable transferable = new RelationMemberTransferable(Collections.<RelationMember>emptyList());
         assertTrue(transferable.isDataFlavorSupported(RELATION_MEMBER_DATA));
@@ -63,5 +64,5 @@
      */
     @Test
-    public void testGetTransferDataNominal() throws UnsupportedFlavorException {
+    void testGetTransferDataNominal() throws UnsupportedFlavorException {
         RelationMemberTransferable rmt = new RelationMemberTransferable(Collections.singleton(new RelationMember("test", new Node(1))));
         assertEquals("node 1 test # incomplete\n", rmt.getTransferData(DataFlavor.stringFlavor));
@@ -80,9 +81,9 @@
     /**
      * Test of {@link RelationMemberTransferable#getTransferData} method - error case.
-     * @throws UnsupportedFlavorException always
      */
-    @Test(expected = UnsupportedFlavorException.class)
-    public void testGetTransferDataError() throws UnsupportedFlavorException {
-        new RelationMemberTransferable(Collections.singleton(new RelationMember(null, new Node(1)))).getTransferData(null);
+    @Test
+    void testGetTransferDataError() {
+        assertThrows(UnsupportedFlavorException.class,
+                () -> new RelationMemberTransferable(Collections.singleton(new RelationMember(null, new Node(1)))).getTransferData(null));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java	(revision 17275)
@@ -2,16 +2,16 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-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.gui.datatransfer.data.TagTransferData;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -22,10 +22,10 @@
  * Unit tests of {@link TagTransferable} class.
  */
-public class TagTransferableTest {
+class TagTransferableTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testIsDataFlavorSupported() {
+    void testIsDataFlavorSupported() {
         TagTransferable tt = new TagTransferable(null);
         assertTrue(tt.isDataFlavorSupported(TagTransferData.FLAVOR));
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testGetTransferDataNominal() throws Exception {
+    void testGetTransferDataNominal() throws Exception {
         Map<String, String> tags = new HashMap<>();
         tags.put("foo", "bar");
@@ -58,10 +58,8 @@
     /**
      * Test of {@link TagTransferable#getTransferData} method - error case.
-     * @throws UnsupportedFlavorException always
-     * @throws IOException never
      */
-    @Test(expected = UnsupportedFlavorException.class)
-    public void testGetTransferDataError() throws UnsupportedFlavorException, IOException {
-        new TagTransferable(null).getTransferData(null);
+    @Test
+    void testGetTransferDataError() {
+        assertThrows(UnsupportedFlavorException.class, () -> new TagTransferable(null).getTransferData(null));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.datatransfer.data;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.NodeData;
@@ -26,9 +26,9 @@
  * @author Michael Zangl
  */
-public class PrimitiveTagTransferDataTest {
+class PrimitiveTagTransferDataTest {
     /**
      * Prefs only required because of the dependencies of OSM primitives.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testPrimitiveTagTransferDataPrimitiveTransferData() {
+    void testPrimitiveTagTransferDataPrimitiveTransferData() {
         PrimitiveTagTransferData data = new PrimitiveTagTransferData(PrimitiveTransferData.getData(Arrays.asList(new Node(), new Node())));
         assertEquals(2, data.getSourcePrimitiveCount(OsmPrimitiveType.NODE));
@@ -53,5 +53,5 @@
      */
     @Test
-    public void testIsHeterogeneousSource() {
+    void testIsHeterogeneousSource() {
         // 0 item
         assertFalse(isHeterogeneousSource());
@@ -74,5 +74,5 @@
      */
     @Test
-    public void testGetForPrimitives() {
+    void testGetForPrimitives() {
         PrimitiveTagTransferData data = createTestData();
         TagCollection forNode = data.getForPrimitives(OsmPrimitiveType.NODE);
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testGetSourcePrimitiveCount() {
+    void testGetSourcePrimitiveCount() {
         PrimitiveTagTransferData data = createTestData();
         assertEquals(2, data.getSourcePrimitiveCount(OsmPrimitiveType.NODE));
@@ -111,5 +111,5 @@
      */
     @Test
-    public void testGetStatistics() {
+    void testGetStatistics() {
         PrimitiveTagTransferData data = createTestData();
         Map<OsmPrimitiveType, Integer> stats = data.getStatistics();
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.datatransfer.importers;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,9 +16,9 @@
  * @author Michael Zangl
  */
-public class OsmLinkPasterTest {
+class OsmLinkPasterTest {
     /**
      * No dependencies
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testParseLatLon() {
+    void testParseLatLon() {
         assertEquals(new LatLon(51.71873, 8.76164),
                 OsmLinkPaster.parseLatLon("https://www.openstreetmap.org/#map=17/51.71873/8.76164"));
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ChangesetDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ChangesetDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ChangesetDialogTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.dialogs;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.dialogs.ChangesetDialog.LaunchChangesetManager;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,10 +13,10 @@
  * Unit tests of {@link ChangesetDialog} class.
  */
-public class ChangesetDialogTest {
+class ChangesetDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(LaunchChangesetManager.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.dialogs;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.Command;
@@ -21,10 +21,10 @@
  * Unit tests of {@link CommandStackDialog} class.
  */
-public class CommandStackDialogTest {
+class CommandStackDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testCommandStackDialogEmpty() {
+    void testCommandStackDialogEmpty() {
         CommandStackDialog dlg = new CommandStackDialog();
         dlg.showDialog();
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testCommandStackDialogNotEmpty() {
+    void testCommandStackDialogNotEmpty() {
         DataSet ds = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(ds, "", null);
@@ -79,5 +79,5 @@
      */
     @Test
-    public void testCommandStackDialogUndoAddCommand() {
+    void testCommandStackDialogUndoAddCommand() {
         DataSet ds = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(ds, "", null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.dialogs;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.awt.Color;
 import java.awt.image.BufferedImage;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -26,10 +26,10 @@
  * Unit tests of {@link ConflictDialog} class.
  */
-public class ConflictDialogTest {
+class ConflictDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testConflictDialog() {
+    void testConflictDialog() {
         assertNotNull(new ConflictDialog());
     }
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testGetColor() {
+    void testGetColor() {
         assertEquals(Color.gray, ConflictDialog.getColor());
     }
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testConflictPainter() {
+    void testConflictPainter() {
         MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));
         ConflictPainter cp = new ConflictPainter(MainApplication.getMap().mapView,
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.dialogs;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.openstreetmap.josm.TestUtils.assertEqualsNewline;
 
@@ -9,8 +9,8 @@
 import javax.swing.JPanel;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -28,10 +28,10 @@
  * Unit tests of {@link InspectPrimitiveDialog} class.
  */
-public class InspectPrimitiveDialogTest {
+class InspectPrimitiveDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection().mapStyles();
@@ -40,5 +40,5 @@
      * Setup test
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         SystemOfMeasurement.PROP_SYSTEM_OF_MEASUREMENT.put("METRIC");
@@ -49,5 +49,5 @@
      * Cleanup test
      */
-    @After
+    @AfterEach
     public void tearDown() {
         SystemOfMeasurement.PROP_SYSTEM_OF_MEASUREMENT.put(null);
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testGenericMonospacePanel() {
+    void testGenericMonospacePanel() {
         assertNotNull(InspectPrimitiveDialog.genericMonospacePanel(new JPanel(), ""));
     }
@@ -66,5 +66,5 @@
      */
     @Test
-    public void testBuildDataText() {
+    void testBuildDataText() {
         DataSet ds = new DataSet();
         assertEqualsNewline("", InspectPrimitiveDialog.buildDataText(ds, new ArrayList<>(ds.allPrimitives())));
@@ -108,5 +108,5 @@
      */
     @Test
-    public void testBuildListOfEditorsText() {
+    void testBuildListOfEditorsText() {
         DataSet ds = new DataSet();
         assertEqualsNewline("0 users last edited the selection:\n\n", InspectPrimitiveDialog.buildListOfEditorsText(ds.allPrimitives()));
@@ -130,5 +130,5 @@
      */
     @Test
-    public void testBuildMapPaintText() {
+    void testBuildMapPaintText() {
         DataSet ds = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(ds, "", null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.dialogs;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -14,10 +14,10 @@
  * Unit tests of {@link MapPaintDialog} class.
  */
-public class MapPaintDialogTest {
+class MapPaintDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testInfoAction() {
+    void testInfoAction() {
         MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));
         MainApplication.getMap().mapPaintDialog.new InfoAction().actionPerformed(null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 17275)
@@ -3,9 +3,9 @@
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -28,6 +28,6 @@
 
 import org.awaitility.Awaitility;
-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.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
@@ -55,10 +55,10 @@
  * Unit tests of {@link MinimapDialog} class.
  */
-public class MinimapDialogTest {
+class MinimapDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().fakeImagery();
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testMinimapDialog() {
+    void testMinimapDialog() {
         MinimapDialog dlg = new MinimapDialog();
         dlg.showDialog();
@@ -102,10 +102,10 @@
                 assertEquals(equalText, isSelected);
                 if (equalText) {
-                    assertFalse("Second selected source found", found);
+                    assertFalse(found, "Second selected source found");
                     found = true;
                 }
             }
         }
-        assertTrue("Selected source not found in menu", found);
+        assertTrue(found, "Selected source not found in menu");
     }
 
@@ -199,5 +199,5 @@
      */
     @Test
-    public void testSourceSwitching() throws Exception {
+    void testSourceSwitching() throws Exception {
         // relevant prefs starting out empty, should choose the first source and have shown download area enabled
         // (not that there's a data layer for it to use)
@@ -246,5 +246,5 @@
      */
     @Test
-    public void testRefreshSourcesRetainsSelection() throws Exception {
+    void testRefreshSourcesRetainsSelection() throws Exception {
         // relevant prefs starting out empty, should choose the first source and have shown download area enabled
         // (not that there's a data layer for it to use)
@@ -284,5 +284,5 @@
      */
     @Test
-    public void testRemovedSourceStillSelected() throws Exception {
+    void testRemovedSourceStillSelected() throws Exception {
         // relevant prefs starting out empty, should choose the first source and have shown download area enabled
         // (not that there's a data layer for it to use)
@@ -317,5 +317,5 @@
      */
     @Test
-    public void testTileSourcesFromCurrentLayers() throws Exception {
+    void testTileSourcesFromCurrentLayers() throws Exception {
         // relevant prefs starting out empty, should choose the first (ImageryLayerInfo) source and have shown download area enabled
         // (not that there's a data layer for it to use)
@@ -451,5 +451,5 @@
      */
     @Test
-    public void testSourcePrefObeyed() throws Exception {
+    void testSourcePrefObeyed() throws Exception {
         Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles");
 
@@ -478,5 +478,5 @@
      */
     @Test
-    public void testSourcePrefInvalid() throws Exception {
+    void testSourcePrefInvalid() throws Exception {
         Config.getPref().put("slippy_map_chooser.mapstyle", "Hooloovoo Tiles");
 
@@ -500,5 +500,5 @@
      */
     @Test
-    public void testViewportAspectRatio() throws Exception {
+    void testViewportAspectRatio() throws Exception {
         // Add a test layer to the layer manager to get the MapFrame & MapView
         MainApplication.getLayerManager().addLayer(new TestLayer());
@@ -546,6 +546,6 @@
         // should equal the number on the right
         assertTrue(
-            "Viewport marker not horizontally centered",
-            Math.abs(rowMatcher.group(1).length() - rowMatcher.group(3).length()) < 4
+            Math.abs(rowMatcher.group(1).length() - rowMatcher.group(3).length()) < 4,
+            "Viewport marker not horizontally centered"
         );
 
@@ -561,12 +561,12 @@
         // should equal the number on the bottom
         assertTrue(
-            "Viewport marker not vertically centered",
-            Math.abs(colMatcher.group(1).length() - colMatcher.group(3).length()) < 4
+            Math.abs(colMatcher.group(1).length() - colMatcher.group(3).length()) < 4,
+            "Viewport marker not vertically centered"
         );
 
         // (within a tolerance for numerical error) the viewport marker should be square
         assertTrue(
-            "Viewport marker not square",
-            Math.abs(colMatcher.group(2).length() - rowMatcher.group(2).length()) < 4
+            Math.abs(colMatcher.group(2).length() - rowMatcher.group(2).length()) < 4,
+            "Viewport marker not square"
         );
 
@@ -591,6 +591,6 @@
         );
         assertTrue(
-            "Viewport marker not horizontally centered",
-            Math.abs(rowMatcher.group(1).length() - rowMatcher.group(3).length()) < 4
+            Math.abs(rowMatcher.group(1).length() - rowMatcher.group(3).length()) < 4,
+            "Viewport marker not horizontally centered"
         );
 
@@ -603,6 +603,6 @@
         );
         assertTrue(
-            "Viewport marker not vertically centered",
-            Math.abs(colMatcher.group(1).length() - colMatcher.group(3).length()) < 4
+            Math.abs(colMatcher.group(1).length() - colMatcher.group(3).length()) < 4,
+            "Viewport marker not vertically centered"
         );
 
@@ -614,6 +614,6 @@
 
         assertTrue(
-            "Viewport marker not 2:1 aspect ratio",
-            Math.abs(colMatcher.group(2).length() - (rowMatcher.group(2).length()*2.0)) < 5
+            Math.abs(colMatcher.group(2).length() - (rowMatcher.group(2).length()*2.0)) < 5,
+            "Viewport marker not 2:1 aspect ratio"
         );
     }
@@ -624,9 +624,9 @@
         for (Component c: menu.getComponents()) {
             if (JPopupMenu.Separator.class.isInstance(c)) {
-                assertFalse("More than one separator before target item", afterSeparator);
+                assertFalse(afterSeparator, "More than one separator before target item");
                 afterSeparator = true;
             } else if (((JMenuItem) c).getText().equals(tr("Show downloaded area"))) {
-                assertTrue("Separator not found before target item", afterSeparator);
-                assertTrue("Target item doesn't appear to be a JCheckBoxMenuItem", JCheckBoxMenuItem.class.isInstance(c));
+                assertTrue(afterSeparator, "Separator not found before target item");
+                assertTrue(JCheckBoxMenuItem.class.isInstance(c), "Target item doesn't appear to be a JCheckBoxMenuItem");
                 return (JCheckBoxMenuItem) c;
             }
@@ -641,5 +641,5 @@
      */
     @Test
-    public void testShowDownloadedArea() throws Exception {
+    void testShowDownloadedArea() throws Exception {
         Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles");
         Config.getPref().putBoolean("slippy_map_chooser.show_downloaded_area", false);
@@ -800,5 +800,5 @@
      */
     @Test
-    public void testShowDownloadedAreaLayerSwitching() throws Exception {
+    void testShowDownloadedAreaLayerSwitching() throws Exception {
         Config.getPref().put("slippy_map_chooser.mapstyle", "Green Tiles");
         Config.getPref().putBoolean("slippy_map_chooser.show_downloaded_area", true);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.dialogs.changeset;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.GraphicsEnvironment;
@@ -14,6 +14,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Changeset;
@@ -41,10 +41,10 @@
  * Unit tests of {@link ChangesetCacheManager} class.
  */
-public class ChangesetCacheManagerTest {
+class ChangesetCacheManagerTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -54,5 +54,5 @@
      */
     @Test
-    public void testDestroyInstance() {
+    void testDestroyInstance() {
         ChangesetCacheManager.destroyInstance();
     }
@@ -64,5 +64,5 @@
      */
     @Test
-    public void testBuild() {
+    void testBuild() {
         assertNotNull(ChangesetCacheManager.buildButtonPanel());
         assertNotNull(ChangesetCacheManager.buildToolbarPanel());
@@ -74,5 +74,5 @@
      */
     @Test
-    public void testChangesetDetailViewSynchronizer() {
+    void testChangesetDetailViewSynchronizer() {
         new ChangesetDetailViewSynchronizer(new ChangesetCacheManagerModel(null) {
             @Override
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testCancelAction() {
+    void testCancelAction() {
         new CancelAction().actionPerformed(null);
     }
@@ -102,5 +102,5 @@
      */
     @Test
-    public void testCloseSelectedChangesetsAction() {
+    void testCloseSelectedChangesetsAction() {
         CloseSelectedChangesetsAction action = new CloseSelectedChangesetsAction(new ChangesetCacheManagerModel(null) {
             @Override
@@ -117,5 +117,5 @@
      */
     @Test
-    public void testDownloadMyChangesets() {
+    void testDownloadMyChangesets() {
         TestUtils.assumeWorkingJMockit();
         final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(
@@ -140,5 +140,5 @@
      */
     @Test
-    public void testDownloadSelectedChangesetContentAction() {
+    void testDownloadSelectedChangesetContentAction() {
         if (GraphicsEnvironment.isHeadless()) {
             TestUtils.assumeWorkingJMockit();
@@ -156,5 +156,5 @@
      */
     @Test
-    public void testDownloadSelectedChangesetsAction() {
+    void testDownloadSelectedChangesetsAction() {
         if (GraphicsEnvironment.isHeadless()) {
             TestUtils.assumeWorkingJMockit();
@@ -172,5 +172,5 @@
      */
     @Test
-    public void testQueryAction() {
+    void testQueryAction() {
         TestUtils.assumeWorkingJMockit();
 
@@ -217,5 +217,5 @@
      */
     @Test
-    public void testRemoveFromCacheAction() {
+    void testRemoveFromCacheAction() {
         RemoveFromCacheAction action = new RemoveFromCacheAction(ChangesetCacheManager.buildModel());
         action.valueChanged(null);
@@ -227,5 +227,5 @@
      */
     @Test
-    public void testShowDetailAction() {
+    void testShowDetailAction() {
         new ShowDetailAction(ChangesetCacheManager.buildModel()).actionPerformed(null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.changeset;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link ChangesetCacheTableColumnModel} class.
  */
-public class ChangesetCacheTableColumnModelTest {
+class ChangesetCacheTableColumnModelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testChangesetCacheTableColumnModel() {
+    void testChangesetCacheTableColumnModel() {
         assertNotNull(new ChangesetCacheTableColumnModel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.changeset;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link ChangesetContentPanel} class.
  */
-public class ChangesetContentPanelTest {
+class ChangesetContentPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testChangesetContentPanel() {
+    void testChangesetContentPanel() {
         assertNotNull(new ChangesetContentPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.changeset;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link ChangesetDetailPanel} class.
  */
-public class ChangesetDetailPanelTest {
+class ChangesetDetailPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testChangesetDetailPanel() {
+    void testChangesetDetailPanel() {
         assertNotNull(new ChangesetDetailPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.changeset;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link ChangesetDiscussionPanel} class.
  */
-public class ChangesetDiscussionPanelTest {
+class ChangesetDiscussionPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testChangesetDiscussionPanel() {
+    void testChangesetDiscussionPanel() {
         assertNotNull(new ChangesetDiscussionPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.changeset;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link ChangesetTagsPanel} class.
  */
-public class ChangesetTagsPanelTest {
+class ChangesetTagsPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testChangesetTagsPanel() {
+    void testChangesetTagsPanel() {
         assertNotNull(new ChangesetTagsPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.changeset.query;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link AdvancedChangesetQueryPanel} class.
  */
-public class AdvancedChangesetQueryPanelTest {
+class AdvancedChangesetQueryPanelTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testAdvancedChangesetQueryPanel() {
+    void testAdvancedChangesetQueryPanel() {
         assertNotNull(new AdvancedChangesetQueryPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.changeset.query;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link BasicChangesetQueryPanel} class.
  */
-public class BasicChangesetQueryPanelTest {
+class BasicChangesetQueryPanelTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testBasicChangesetQueryPanel() {
+    void testBasicChangesetQueryPanel() {
         assertNotNull(new BasicChangesetQueryPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanelTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.dialogs.changeset.query;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-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.testutils.JOSMTestRules;
 
@@ -14,10 +14,10 @@
  * Unit tests of {@link UrlBasedQueryPanel} class.
  */
-public class UrlBasedQueryPanelTest {
+class UrlBasedQueryPanelTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testUrlBasedQueryPanel() {
+    void testUrlBasedQueryPanel() {
         assertNotNull(new UrlBasedQueryPanel());
     }
@@ -35,7 +35,7 @@
      */
     @Test
-    public void testExamplesAreCorrect() {
+    void testExamplesAreCorrect() {
         for (String example : UrlBasedQueryPanel.getExamples()) {
-            assertTrue(example, UrlBasedQueryPanel.isValidChangesetQueryUrl(example));
+            assertTrue(UrlBasedQueryPanel.isValidChangesetQueryUrl(example), example);
         }
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/CycleLayerActionTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.dialogs.layer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+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.ImageryLayerInfo;
@@ -24,7 +24,7 @@
  * @author Taylor Smock
  */
-public class CycleLayerActionTest {
+class CycleLayerActionTest {
     /** Layers need a projection */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().preferences().projection().fakeImagery();
@@ -37,5 +37,5 @@
      * Set up common items (make layers, etc.)
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         cycleDown = new CycleLayerDownAction();
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testDownBottom() {
+    void testDownBottom() {
         manager.setActiveLayer(manager.getLayers().get(0));
         cycleDown.actionPerformed(null);
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testUpTop() {
+    void testUpTop() {
         manager.setActiveLayer(manager.getLayers().get(manager.getLayers().size() - 1));
         cycleUp.actionPerformed(null);
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testDown() {
+    void testDown() {
         manager.setActiveLayer(manager.getLayers().get(3));
         cycleDown.actionPerformed(null);
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testUp() {
+    void testUp() {
         manager.setActiveLayer(manager.getLayers().get(3));
         cycleUp.actionPerformed(null);
@@ -91,5 +91,5 @@
      */
     @Test
-    public void testNoLayers() {
+    void testNoLayers() {
         manager.getLayers().forEach(manager::removeLayer);
         cycleUp.actionPerformed(null);
@@ -102,5 +102,5 @@
      */
     @Test
-    public void testWithAerialImagery() {
+    void testWithAerialImagery() {
         final ImageryInfo magentaTilesInfo = ImageryLayerInfo.instance.getLayers().stream()
                 .filter(i -> i.getName().equals("Magenta Tiles")).findAny().get();
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/DuplicateActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/DuplicateActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/DuplicateActionTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.dialogs.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.io.InputStream;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -22,9 +22,9 @@
  * Unit tests of {@link DuplicateAction} class.
  */
-public class DuplicateActionTest {
+class DuplicateActionTest {
     /**
      * TMS layer needs prefs. Platform for LayerListDialog shortcuts.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testTicket4539() throws Exception {
+    void testTicket4539() throws Exception {
         try (InputStream is = TestUtils.getRegressionDataStream(4539, "josm_error_#4539.osm.zip")) {
             OsmDataLayer layer = new OsmDataLayer(OsmReader.parseDataSet(is, null), null, null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.dialogs.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
@@ -20,9 +20,9 @@
  * Unit tests of {@link LayerVisibilityAction} class.
  */
-public class LayerVisibilityActionTest {
+class LayerVisibilityActionTest {
     /**
      * TMS layer needs prefs. Platform for LayerListDialog shortcuts.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection().main();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testLayerVisibilityAction() {
+    void testLayerVisibilityAction() {
         TMSLayer layer = TMSLayerTest.createTmsLayer();
         LayerListModel model = new LayerListDialog(MainApplication.getLayerManager()) {
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRendererTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.dialogs.properties;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.function.IntFunction;
@@ -10,6 +10,6 @@
 import javax.swing.table.DefaultTableModel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -19,10 +19,10 @@
  * Unit tests of {@link PropertiesCellRenderer} class.
  */
-public class PropertiesCellRendererTest {
+class PropertiesCellRendererTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testColorRendering() {
+    void testColorRendering() {
         PropertiesCellRenderer renderer = new PropertiesCellRenderer();
         DefaultTableModel tableModel = new DefaultTableModel(new Object[][]{
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.dialogs.properties;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.Node;
@@ -20,10 +20,10 @@
  * Unit tests of {@link PropertiesDialog} class.
  */
-public class PropertiesDialogTest {
+class PropertiesDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testTicket12504() {
+    void testTicket12504() {
         List<OsmPrimitive> sel = new ArrayList<>();
         // 160 objects with foo=bar, 400 objects without foo
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollectionTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.dialogs.properties;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Tag;
 import org.openstreetmap.josm.data.osm.search.SearchParseError;
@@ -22,10 +22,10 @@
  * Unit tests of {@link RecentTagCollection} class.
  */
-public class RecentTagCollectionTest {
+class RecentTagCollectionTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testVarious() throws SearchParseError {
+    void testVarious() throws SearchParseError {
         final RecentTagCollection recentTags = new RecentTagCollection(2);
         assertTrue(recentTags.isEmpty());
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelperTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelperTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelperTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.dialogs.properties;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.awt.GraphicsEnvironment;
@@ -21,6 +21,6 @@
 import javax.swing.table.DefaultTableModel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -44,10 +44,10 @@
  * Unit tests of {@link TagEditHelper} class.
  */
-public class TagEditHelperTest {
+class TagEditHelperTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().territories().projection();
@@ -64,5 +64,5 @@
      */
     @Test
-    public void testAcItemComparator() {
+    void testAcItemComparator() {
         List<AutoCompletionItem> list = new ArrayList<>();
         list.add(new AutoCompletionItem("Bing Sat"));
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testContainsDataKey() {
+    void testContainsDataKey() {
         assertFalse(newTagEditHelper().containsDataKey("foo"));
         // TODO: complete test
@@ -92,5 +92,5 @@
      */
     @Test
-    public void testTicket18764() throws Exception {
+    void testTicket18764() throws Exception {
         testIcon("*[building] ⧉ *[highway] { text: tr(\"Building crossing highway\"); }", ds -> {
             Way way = TestUtils.newWay("", new Node(LatLon.NORTH_POLE), new Node(LatLon.SOUTH_POLE));
@@ -106,5 +106,5 @@
      */
     @Test
-    public void testTicket18798() throws Exception {
+    void testTicket18798() throws Exception {
         testIcon("node:righthandtraffic[junction=roundabout] { text: tr(\"Roundabout node\"); }", ds -> {
             Node node = new Node(LatLon.NORTH_POLE);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TaginfoActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TaginfoActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/TaginfoActionTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.dialogs.properties;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import javax.swing.Action;
 
-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.data.osm.Tag;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
-public class TaginfoActionTest {
+class TaginfoActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testTaginfoUrls() {
+    void testTaginfoUrls() {
         TaginfoAction action = new TaginfoAction(() -> null, () -> null);
         assertEquals("https://taginfo.openstreetmap.org/keys/railway", action.getTaginfoUrlForTag(new Tag("railway")));
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testCustomInstance() {
+    void testCustomInstance() {
         TaginfoAction action = new TaginfoAction(() -> null, () -> null).withTaginfoUrl("example.com", "https://taginfo.example.com////");
         assertEquals("example.com", action.getValue(Action.NAME));
@@ -50,5 +50,5 @@
      */
     @Test
-    public void testTagHistoryUrls() throws Exception {
+    void testTagHistoryUrls() {
         TaginfoAction action = new TaginfoAction(() -> null, () -> null).toTagHistoryAction();
         assertEquals("https://taghistory.raifer.tech/#***/railway/", action.getTaginfoUrlForTag(new Tag("railway")));
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowserTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.Relation;
@@ -16,10 +16,10 @@
  * Unit tests of {@link ChildRelationBrowser} class.
  */
-public class ChildRelationBrowserTest {
+class ChildRelationBrowserTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testChildRelationBrowser() {
+    void testChildRelationBrowser() {
         DataSet ds = new DataSet();
         Relation r = new Relation();
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+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 java.util.Collections;
@@ -11,6 +11,6 @@
 import javax.swing.JPanel;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -35,5 +35,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().main();
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testAddPrimitivesToRelation() {
+    void testAddPrimitivesToRelation() {
         TestUtils.assumeWorkingJMockit();
         final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker();
@@ -117,5 +117,5 @@
      */
     @Test
-    public void testBuild() {
+    void testBuild() {
         DataSet ds = new DataSet();
         Relation relation = new Relation(1);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRendererTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.JTable;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionType;
@@ -17,10 +17,10 @@
  * Unit tests of {@link MemberTableLinkedCellRenderer} class.
  */
-public class MemberTableLinkedCellRendererTest {
+class MemberTableLinkedCellRendererTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testMemberTableLinkedCellRenderer() {
+    void testMemberTableLinkedCellRenderer() {
         MemberTableLinkedCellRenderer r = new MemberTableLinkedCellRenderer();
         assertEquals(r, r.getTableCellRendererComponent(null, null, false, false, 0, 0));
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRendererTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.JTable;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.Node;
@@ -18,10 +18,10 @@
  * Unit tests of {@link MemberTableMemberCellRenderer} class.
  */
-public class MemberTableMemberCellRendererTest {
+class MemberTableMemberCellRendererTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testMemberTableMemberCellRenderer() {
+    void testMemberTableMemberCellRenderer() {
         MemberTableMemberCellRenderer r = new MemberTableMemberCellRenderer();
         assertEquals(r, r.getTableCellRendererComponent(null, null, false, false, 0, 0));
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModelTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.Collection;
@@ -8,6 +8,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -21,10 +21,10 @@
  * Unit tests of {@link MemberTableModel} class.
  */
-public class MemberTableModelTest {
+class MemberTableModelTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testTicket12443() {
+    void testTicket12443() {
         final Node n = new Node(1);
         assertNotNull(new MemberTableModel(null, null, new TaggingPresetHandler() {
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableRoleCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableRoleCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/MemberTableRoleCellRendererTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.JTable;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -17,10 +17,10 @@
  * Unit tests of {@link MemberTableRoleCellRenderer} class.
  */
-public class MemberTableRoleCellRendererTest {
+class MemberTableRoleCellRendererTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testMemberTableRoleCellRenderer() {
+    void testMemberTableRoleCellRenderer() {
         MemberTableRoleCellRenderer r = new MemberTableRoleCellRenderer();
         assertEquals(r, r.getTableCellRendererComponent(null, null, false, false, 0, 0));
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.Relation;
@@ -14,10 +14,10 @@
  * Unit tests of {@link ReferringRelationsBrowser} class.
  */
-public class ReferringRelationsBrowserTest {
+class ReferringRelationsBrowserTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testReferringRelationsBrowser() {
+    void testReferringRelationsBrowser() {
         DataSet ds = new DataSet();
         Relation r = new Relation();
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRendererTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.JTree;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,10 +16,10 @@
  * Unit tests of {@link RelationTreeCellRenderer} class.
  */
-public class RelationTreeCellRendererTest {
+class RelationTreeCellRendererTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testRelationTreeCellRenderer() {
+    void testRelationTreeCellRenderer() {
         RelationTreeCellRenderer r = new RelationTreeCellRenderer();
         assertEquals(r, r.getTreeCellRendererComponent(new JTree(), new Relation(), false, false, false, 0, false));
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRendererTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.JTable;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,10 +16,10 @@
  * Unit tests of {@link SelectionTableCellRenderer} class.
  */
-public class SelectionTableCellRendererTest {
+class SelectionTableCellRendererTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testSelectionTableCellRenderer() {
+    void testSelectionTableCellRenderer() {
         MemberTableModel model = new MemberTableModel(null, null, null);
         SelectionTableCellRenderer r = new SelectionTableCellRenderer(model);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -25,10 +25,10 @@
  * Unit tests of {@link SelectionTable} class.
  */
-public class SelectionTableTest {
+class SelectionTableTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -38,5 +38,5 @@
      */
     @Test
-    public void testSelectionTable() {
+    void testSelectionTable() {
         // Constructs a relation with a member
         DataSet ds = new DataSet();
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java	(revision 17275)
@@ -6,7 +6,7 @@
 import java.util.List;
 
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
+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;
@@ -31,10 +31,10 @@
  * @author Michael Zangl
  */
-@Ignore
+@Disabled
 public abstract class AbstractRelationEditorActionTest {
     /**
      * Platform for tooltips.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().main();
@@ -91,5 +91,5 @@
      * Set up the test data required for common tests using one relation.
      */
-    @Before
+    @BeforeEach
     public void setupTestData() {
         DataSet ds = new DataSet();
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/PasteMembersActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/PasteMembersActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/PasteMembersActionTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.dialogs.relation.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 import java.util.Set;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Relation;
@@ -24,10 +24,10 @@
  * @author Michael Zangl
  */
-public class PasteMembersActionTest extends AbstractRelationEditorActionTest {
+class PasteMembersActionTest extends AbstractRelationEditorActionTest {
     /**
      * Test {@link PasteMembersAction#isEnabled()}
      */
     @Test
-    public void testEnabledState() {
+    void testEnabledState() {
         copyString();
 
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testActionWrongClipboard() {
+    void testActionWrongClipboard() {
         copyString();
         PasteMembersAction action = new PasteMembersAction(relationEditorAccess);
@@ -79,5 +79,5 @@
      */
     @Test
-    public void testActionForMembers() {
+    void testActionForMembers() {
         Node testNode = new Node(10);
         layer.data.addPrimitive(testNode);
@@ -97,5 +97,5 @@
      */
     @Test
-    public void testActionForPrimitives() {
+    void testActionForPrimitives() {
         Node testNode = new Node(10);
         layer.data.addPrimitive(testNode);
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/RelationEditorActionsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/RelationEditorActionsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/RelationEditorActionsTest.java	(revision 17275)
@@ -2,13 +2,15 @@
 package org.openstreetmap.josm.gui.dialogs.relation.actions;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.Component;
 import java.awt.Container;
+
 import javax.swing.Icon;
 import javax.swing.JOptionPane;
 import javax.swing.text.JTextComponent;
 
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
@@ -18,10 +20,8 @@
 import mockit.MockUp;
 
-import org.junit.Test;
-
 /**
  * Unit tests for relation editor actions.
  */
-public class RelationEditorActionsTest extends AbstractRelationEditorActionTest {
+class RelationEditorActionsTest extends AbstractRelationEditorActionTest {
 
     /**
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testNoDialogActions() {
+    void testNoDialogActions() {
         new AddSelectedAfterSelection(relationEditorAccess).actionPerformed(null);
         new AddSelectedBeforeSelection(relationEditorAccess).actionPerformed(null);
@@ -69,7 +69,8 @@
      */
     @Test
-    public void testDeleteCurrentRelationAction() {
+    void testDeleteCurrentRelationAction() {
         TestUtils.assumeWorkingJMockit();
         final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker() {
+            @Override
             public String getStringFromOriginalMessage(Object originalMessage) {
                 return ((JTextComponent) ((Container) originalMessage).getComponent(0)).getText();
@@ -105,5 +106,5 @@
      */
     @Test
-    public void testSetRoleAction() {
+    void testSetRoleAction() {
         TestUtils.assumeWorkingJMockit();
         final JOptionPaneSimpleMocker.MessagePanelMocker mpMocker = new JOptionPaneSimpleMocker.MessagePanelMocker();
@@ -111,5 +112,5 @@
         // complexity, but this is quite a simple use of showOptionDialog which we can mock from scratch.
         final boolean[] jopMockerCalled = new boolean[] {false};
-        final MockUp<JOptionPane> jopMocker = new MockUp<JOptionPane>() {
+        new MockUp<JOptionPane>() {
             @Mock
             public int showOptionDialog(
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java	(revision 17275)
@@ -9,7 +9,7 @@
 
 import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -25,5 +25,5 @@
  * Unit tests of {@link RelationSorter} class.
  */
-public class RelationSorterTest {
+class RelationSorterTest {
 
     private final RelationSorter sorter = new RelationSorter();
@@ -33,5 +33,5 @@
      * Use Mercator projection
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
@@ -42,5 +42,5 @@
      * @throws IOException in case of I/O error
      */
-    @Before
+    @BeforeEach
     public void loadData() throws IllegalDataException, IOException {
         if (testDataset == null) {
@@ -64,5 +64,5 @@
 
     @Test
-    public void testGeneric() {
+    void testGeneric() {
         String[] actual = getNames(sorter.sortMembers(getRelation("generic").getMembers()));
         final String[] expected = {"t1w4", "t1w3", "t1w2", "t1w1", "t1w7", "t1w6", "t1w5", "t1n1", "t1n2"};
@@ -73,5 +73,5 @@
 
     @Test
-    public void testAssociatedStreet() {
+    void testAssociatedStreet() {
         String[] actual = getNames(sorter.sortMembers(getRelation("associatedStreet").getMembers()));
         Assert.assertArrayEquals(new String[] {"t2w1", "t2w2", "t2n1", "t2n2", "t2n3", "t2n4"}, actual);
@@ -79,5 +79,5 @@
 
     @Test
-    public void testStreet() {
+    void testStreet() {
         String[] actual = getNames(sorter.sortMembers(getRelation("street").getMembers()));
         Assert.assertArrayEquals(new String[]{"t2w1", "t2w2", "t2n1", "t2n2", "t2n3", "t2n4", "playground", "tree"}, actual);
@@ -90,5 +90,5 @@
 
     @Test
-    public void testThreeLoopsEndsLoop() {
+    void testThreeLoopsEndsLoop() {
         Relation relation = getRelation("three-loops-ends-loop");
         // Check the first way before sorting, otherwise the sorter
@@ -106,5 +106,5 @@
 
     @Test
-    public void testThreeLoopsEndsWay() {
+    void testThreeLoopsEndsWay() {
         Relation relation = getRelation("three-loops-ends-way");
         // Check the first way before sorting, otherwise the sorter
@@ -122,5 +122,5 @@
 
     @Test
-    public void testThreeLoopsEndsNode() {
+    void testThreeLoopsEndsNode() {
         Relation relation = getRelation("three-loops-ends-node");
         String[] actual = getNames(sorter.sortMembers(relation.getMembers()));
@@ -133,5 +133,5 @@
 
     @Test
-    public void testOneLoopEndsSplit() {
+    void testOneLoopEndsSplit() {
         Relation relation = getRelation("one-loop-ends-split");
         String[] actual = getNames(sorter.sortMembers(relation.getMembers()));
@@ -144,5 +144,5 @@
 
     @Test
-    public void testNoLoopEndsSplit() {
+    void testNoLoopEndsSplit() {
         Relation relation = getRelation("no-loop-ends-split");
         // TODO: This is not yet sorted properly, so this route is
@@ -157,5 +157,5 @@
 
     @Test
-    public void testIncompleteLoops() {
+    void testIncompleteLoops() {
         Relation relation = getRelation("incomplete-loops");
         // TODO: This is not yet sorted perfectly (might not be possible)
@@ -169,5 +169,5 @@
 
     @Test
-    public void testParallelOneWay() {
+    void testParallelOneWay() {
         Relation relation = getRelation("parallel-oneway");
         // TODO: This is not always sorted properly, only when the right
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java	(revision 17275)
@@ -13,7 +13,7 @@
 
 import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -31,5 +31,5 @@
  * Unit tests of {@link WayConnectionTypeCalculator} class.
  */
-public class WayConnectionTypeCalculatorTest {
+class WayConnectionTypeCalculatorTest {
 
     private final RelationSorter sorter = new RelationSorter();
@@ -40,5 +40,5 @@
      * Use Mercator projection
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
@@ -49,5 +49,5 @@
      * @throws IOException in case of I/O error
      */
-    @Before
+    @BeforeEach
     public void loadData() throws IllegalDataException, IOException {
         if (testDataset == null) {
@@ -100,5 +100,5 @@
 
     @Test
-    public void testEmpty() {
+    void testEmpty() {
         String actual = getConnections(wayConnectionTypeCalculator.updateLinks(new ArrayList<>()));
         Assert.assertEquals("[]", actual);
@@ -110,5 +110,5 @@
 
     @Test
-    public void testGeneric() {
+    void testGeneric() {
         Relation relation = getRelation("generic");
         String actual = getConnections(wayConnectionTypeCalculator.updateLinks(relation.getMembers()));
@@ -119,5 +119,5 @@
 
     @Test
-    public void testAssociatedStreet() {
+    void testAssociatedStreet() {
         Relation relation = getRelation("associatedStreet");
         String actual = getConnections(wayConnectionTypeCalculator.updateLinks(relation.getMembers()));
@@ -128,5 +128,5 @@
 
     @Test
-    public void testLoop() {
+    void testLoop() {
         Relation relation = getRelation("loop");
         String actual = getConnections(wayConnectionTypeCalculator.updateLinks(relation.getMembers()));
@@ -143,5 +143,5 @@
 
     @Test
-    public void testThreeLoopsEndsLoop() {
+    void testThreeLoopsEndsLoop() {
         Relation relation = getRelation("three-loops-ends-loop");
         // Check the first way before sorting, otherwise the sorter
@@ -159,5 +159,5 @@
 
     @Test
-    public void testThreeLoopsEndsWay() {
+    void testThreeLoopsEndsWay() {
         Relation relation = getRelation("three-loops-ends-way");
         // Check the first way before sorting, otherwise the sorter
@@ -175,5 +175,5 @@
 
     @Test
-    public void testThreeLoopsEndsNode() {
+    void testThreeLoopsEndsNode() {
         Relation relation = getRelation("three-loops-ends-node");
         String actual = getConnections(wayConnectionTypeCalculator.updateLinks(sorter.sortMembers(relation.getMembers())));
@@ -187,5 +187,5 @@
 
     @Test
-    public void testOneLoopEndsSplit() {
+    void testOneLoopEndsSplit() {
         Relation relation = getRelation("one-loop-ends-split");
         String actual = getConnections(wayConnectionTypeCalculator.updateLinks(sorter.sortMembers(relation.getMembers())));
@@ -199,5 +199,5 @@
 
     @Test
-    public void testNoLoopEndsSplit() {
+    void testNoLoopEndsSplit() {
         Relation relation = getRelation("no-loop-ends-split");
         // TODO: This is not yet sorted properly, so this route is
@@ -212,5 +212,5 @@
 
     @Test
-    public void testIncompleteLoops() {
+    void testIncompleteLoops() {
         Relation relation = getRelation("incomplete-loops");
         // TODO: This is not yet sorted perfectly (might not be possible)
@@ -225,5 +225,5 @@
 
     @Test
-    public void testParallelOneWay() {
+    void testParallelOneWay() {
         Relation relation = getRelation("parallel-oneway");
         // TODO: This is not always sorted properly, only when the right
@@ -250,5 +250,5 @@
      */
     @Test
-    public void testDirectionsOnewaysOnly() {
+    void testDirectionsOnewaysOnly() {
         Relation relation = getRelation("direction");
 
@@ -318,5 +318,5 @@
      */
     @Test
-    public void testDirectionsOnewayMix() {
+    void testDirectionsOnewayMix() {
         Relation relation = getRelation("direction");
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.dialogs.validator;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+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 java.util.ArrayList;
@@ -13,6 +13,6 @@
 import java.util.Set;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -26,10 +26,10 @@
  * Unit tests of {@link ValidatorTreePanel} class.
  */
-public class ValidatorTreePanelTest {
+class ValidatorTreePanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testValidatorTreePanel() {
+    void testValidatorTreePanel() {
         assertNotNull(new ValidatorTreePanel());
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/download/BookmarkSelectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/download/BookmarkSelectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/download/BookmarkSelectionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.download;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -12,10 +12,10 @@
  * Unit tests of {@link BookmarkSelection} class.
  */
-public class BookmarkSelectionTest {
+class BookmarkSelectionTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testBookmarkSelection() {
+    void testBookmarkSelection() {
         BookmarkSelection sel = new BookmarkSelection();
         sel.addGui(null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/download/BoundingBoxSelectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/download/BoundingBoxSelectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/download/BoundingBoxSelectionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.download;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -12,10 +12,10 @@
  * Unit tests of {@link BoundingBoxSelection} class.
  */
-public class BoundingBoxSelectionTest {
+class BoundingBoxSelectionTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testBoundingBoxSelection() {
+    void testBoundingBoxSelection() {
         BoundingBoxSelection sel = new BoundingBoxSelection();
         sel.addGui(null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/download/PlaceSelectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/download/PlaceSelectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/download/PlaceSelectionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.download;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -12,10 +12,10 @@
  * Unit tests of {@link PlaceSelection} class.
  */
-public class PlaceSelectionTest {
+class PlaceSelectionTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testBookmarkSelection() {
+    void testBookmarkSelection() {
         PlaceSelection sel = new PlaceSelection();
         sel.addGui(null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/download/TileSelectionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/download/TileSelectionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/download/TileSelectionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.download;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -12,10 +12,10 @@
  * Unit tests of {@link TileSelection} class.
  */
-public class TileSelectionTest {
+class TileSelectionTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testTileSelection() {
+    void testTileSelection() {
         TileSelection sel = new TileSelection();
         sel.addGui(null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.help;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-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.testutils.JOSMTestRules;
 
@@ -13,10 +14,10 @@
  * Unit tests of {@link HelpContentReader} class.
  */
-public class HelpContentReaderTest {
+class HelpContentReaderTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().timeout(30000);
@@ -24,9 +25,8 @@
     /**
      * Unit test of {@link HelpContentReader#fetchHelpTopicContent} - null case.
-     * @throws HelpContentReaderException always
      */
-    @Test(expected = HelpContentReaderException.class)
-    public void testFetchHelpTopicContentNull() throws HelpContentReaderException {
-        new HelpContentReader(null).fetchHelpTopicContent(null, false);
+    @Test
+    void testFetchHelpTopicContentNull() {
+        assertThrows(HelpContentReaderException.class, () -> new HelpContentReader(null).fetchHelpTopicContent(null, false));
     }
 
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testFetchHelpTopicContentNominal() throws HelpContentReaderException {
+    void testFetchHelpTopicContentNominal() throws HelpContentReaderException {
         String res = new HelpContentReader(HelpUtil.getWikiBaseUrl()).fetchHelpTopicContent(HelpBrowserTest.URL_1, false);
         assertFalse(res.trim().isEmpty());
Index: trunk/test/unit/org/openstreetmap/josm/gui/help/HyperlinkHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/help/HyperlinkHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/help/HyperlinkHandlerTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.help;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.StringReader;
@@ -11,6 +11,6 @@
 import javax.swing.text.html.HTMLEditorKit;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -21,10 +21,10 @@
  * Unit tests of {@link HyperlinkHandler} class.
  */
-public class HyperlinkHandlerTest {
+class HyperlinkHandlerTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testTicket17338() throws Exception {
+    void testTicket17338() throws Exception {
         JosmEditorPane help = new JosmEditorPane();
         HTMLEditorKit htmlKit = new HTMLEditorKit();
Index: trunk/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/history/CoordinateInfoViewerTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.history;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-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.testutils.JOSMTestRules;
 
@@ -13,10 +14,10 @@
  * Unit tests of {@link CoordinateInfoViewer} class.
  */
-public class CoordinateInfoViewerTest {
+class CoordinateInfoViewerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,7 +26,7 @@
      * Test for {@link CoordinateInfoViewer#CoordinateInfoViewer} - {@code null} handling.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testCoordinateInfoViewerNull() {
-        new CoordinateInfoViewer(null);
+    @Test
+    void testCoordinateInfoViewerNull() {
+        assertThrows(IllegalArgumentException.class, () -> new CoordinateInfoViewer(null));
     }
 
@@ -34,5 +35,5 @@
      */
     @Test
-    public void testCoordinateInfoViewerNominal() {
+    void testCoordinateInfoViewerNominal() {
         assertNotNull(new CoordinateInfoViewer(new HistoryBrowserModel()));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserDialogTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.history;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Date;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.User;
@@ -22,10 +22,10 @@
  * Unit tests of {@link HistoryBrowserDialog} class.
  */
-public class HistoryBrowserDialogTest {
+class HistoryBrowserDialogTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testBuildTitle() {
+    void testBuildTitle() {
         HistoryDataSet hds = new HistoryDataSet();
         User user = User.createOsmUser(1, "");
Index: trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.history;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+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 org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
@@ -24,10 +24,10 @@
  * Unit tests of {@link HistoryBrowserModel} class.
  */
-public class HistoryBrowserModelTest {
+class HistoryBrowserModelTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(30000);
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testHistoryBrowserModel() {
+    void testHistoryBrowserModel() {
         HistoryBrowserModel model = new HistoryBrowserModel();
         assertNotNull(model.getVersionTableModel());
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testGetTagTableModel() {
+    void testGetTagTableModel() {
         HistoryBrowserModel model = new HistoryBrowserModel();
         TagTableModel t1 = model.getTagTableModel(PointInTimeType.CURRENT_POINT_IN_TIME);
@@ -70,5 +70,5 @@
      */
     @Test
-    public void testGetNodeListTableModel() {
+    void testGetNodeListTableModel() {
         HistoryBrowserModel model = new HistoryBrowserModel();
         DiffTableModel t1 = model.getNodeListTableModel(PointInTimeType.CURRENT_POINT_IN_TIME);
@@ -83,5 +83,5 @@
      */
     @Test
-    public void testGetRelationMemberTableModel() {
+    void testGetRelationMemberTableModel() {
         HistoryBrowserModel model = new HistoryBrowserModel();
         DiffTableModel t1 = model.getRelationMemberTableModel(PointInTimeType.CURRENT_POINT_IN_TIME);
@@ -96,5 +96,5 @@
      */
     @Test
-    public void testSetPointsInTimeNullHistory() {
+    void testSetPointsInTimeNullHistory() {
         HistoryBrowserModel model = new HistoryBrowserModel();
         VersionTableModel tableModel = model.getVersionTableModel();
@@ -109,5 +109,5 @@
      */
     @Test
-    public void testSetPointsInTimeNodeHistory() {
+    void testSetPointsInTimeNodeHistory() {
         SimplePrimitiveId id = new SimplePrimitiveId(2, OsmPrimitiveType.NODE);
         new HistoryLoadTask().add(id).run();
@@ -132,5 +132,5 @@
      */
     @Test
-    public void testSetPointsInTimeWayHistory() {
+    void testSetPointsInTimeWayHistory() {
         SimplePrimitiveId id = new SimplePrimitiveId(2, OsmPrimitiveType.WAY);
         new HistoryLoadTask().add(id).run();
@@ -155,5 +155,5 @@
      */
     @Test
-    public void testSetPointsInTimeRelationHistory() {
+    void testSetPointsInTimeRelationHistory() {
         SimplePrimitiveId id = new SimplePrimitiveId(2, OsmPrimitiveType.RELATION);
         new HistoryLoadTask().add(id).run();
Index: trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.history;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Node;
@@ -30,10 +30,10 @@
  * Unit tests of {@link HistoryLoadTask} class.
  */
-public class HistoryLoadTaskTest {
+class HistoryLoadTaskTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
@@ -43,5 +43,5 @@
      */
     @Test
-    public void testGetLoadingMessage() {
+    void testGetLoadingMessage() {
         assertEquals("Loading history for node {0}", HistoryLoadTask.getLoadingMessage(new Node().getPrimitiveId()));
         assertEquals("Loading history for way {0}", HistoryLoadTask.getLoadingMessage(new Way().getPrimitiveId()));
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testLoadHistory() throws OsmTransferException {
+    void testLoadHistory() throws OsmTransferException {
         HistoryDataSet ds = HistoryLoadTask.loadHistory(new OsmServerHistoryReader(OsmPrimitiveType.NODE, 0) {
             @Override
Index: trunk/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/history/NodeListViewerTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.history;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-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.testutils.JOSMTestRules;
 
@@ -13,10 +14,10 @@
  * Unit tests of {@link NodeListViewer} class.
  */
-public class NodeListViewerTest {
+class NodeListViewerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,7 +26,7 @@
      * Test for {@link NodeListViewer#NodeListViewer} - {@code null} handling.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testNodeListViewerNull() {
-        new NodeListViewer(null);
+    @Test
+    void testNodeListViewerNull() {
+        assertThrows(IllegalArgumentException.class, () -> new NodeListViewer(null));
     }
 
@@ -34,5 +35,5 @@
      */
     @Test
-    public void testNodeListViewerNominal() {
+    void testNodeListViewerNominal() {
         assertNotNull(new NodeListViewer(new HistoryBrowserModel()));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/ActionFlagsTableCellTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/ActionFlagsTableCellTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/ActionFlagsTableCellTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
@@ -10,6 +10,6 @@
 import javax.swing.JTable;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.AbstractModifiableLayer;
@@ -22,9 +22,9 @@
  * Unit tests of {@link ActionFlagsTableCell} class.
  */
-public class ActionFlagsTableCellTest {
+class ActionFlagsTableCellTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testActionFlagsTableCell() {
+    void testActionFlagsTableCell() {
         JTable table = new JTable();
         File file = new File("test");
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java	(revision 17275)
@@ -7,9 +7,9 @@
 import javax.swing.JOptionPane;
 
-import org.junit.After;
 import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -29,5 +29,5 @@
  * Unit tests of {@link AsynchronousUploadPrimitivesTask}.
  */
-public class AsynchronousUploadPrimitivesTaskTest {
+class AsynchronousUploadPrimitivesTaskTest {
 
     private UploadStrategySpecification strategy;
@@ -40,5 +40,5 @@
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().assertionsInEDT();
@@ -47,5 +47,5 @@
      * Bootstrap.
      */
-    @Before
+    @BeforeEach
     public void bootStrap() {
         DataSet dataSet = new DataSet();
@@ -71,5 +71,5 @@
      * Tear down.
      */
-    @After
+    @AfterEach
     public void tearDown() {
         toUpload = null;
@@ -87,5 +87,5 @@
      */
     @Test
-    public void testSingleUploadInstance() {
+    void testSingleUploadInstance() {
         TestUtils.assumeWorkingJMockit();
         new JOptionPaneSimpleMocker(Collections.singletonMap(
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link BasicUploadSettingsPanel} class.
  */
-public class BasicUploadSettingsPanelTest {
+class BasicUploadSettingsPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testBasicUploadSettingsPanel() {
+    void testBasicUploadSettingsPanel() {
         assertNotNull(new BasicUploadSettingsPanel(new ChangesetCommentModel(), new ChangesetCommentModel(), new ChangesetReviewModel()));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCellRendererTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.JList;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,9 +16,9 @@
  * Unit tests of {@link ChangesetCellRenderer} class.
  */
-public class ChangesetCellRendererTest {
+class ChangesetCellRendererTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testChangesetCellRenderer() {
+    void testChangesetCellRenderer() {
         JList<Changeset> list = new JList<>();
         Changeset cs = new Changeset();
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCommentModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCommentModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetCommentModelTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -16,10 +16,10 @@
  * Unit tests of {@link ChangesetCommentModel} class.
  */
-public class ChangesetCommentModelTest {
+class ChangesetCommentModelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testFindHashTags() {
+    void testFindHashTags() {
         ChangesetCommentModel model = new ChangesetCommentModel();
         assertEquals(Collections.emptyList(), model.findHashTags());
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetManagementPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetManagementPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/ChangesetManagementPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link ChangesetManagementPanel} class.
  */
-public class ChangesetManagementPanelTest {
+class ChangesetManagementPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testChangesetManagementPanel() {
+    void testChangesetManagementPanel() {
         assertNotNull(new ChangesetManagementPanel(new ChangesetCommentModel()));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/CredentialDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/CredentialDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/CredentialDialogTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.io.CredentialDialog.CredentialPanel;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -17,10 +17,10 @@
  * Unit tests of {@link CredentialDialog} class.
  */
-public class CredentialDialogTest {
+class CredentialDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testCredentialPanel() {
+    void testCredentialPanel() {
         CredentialPanel cp = new CredentialPanel(null);
         cp.build();
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
@@ -13,6 +13,6 @@
 import java.util.Collections;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.Preferences;
@@ -27,10 +27,10 @@
  * Unit tests for class {@link CustomConfigurator}.
  */
-public class CustomConfiguratorTest {
+class CustomConfiguratorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testExportPreferencesKeysToFile() throws IOException {
+    void testExportPreferencesKeysToFile() throws IOException {
         File tmp = File.createTempFile("josm.testExportPreferencesKeysToFile.lorem_ipsum", ".xml");
 
@@ -58,5 +58,5 @@
         assertTrue(xml.contains("<preferences operation=\"replace\">"));
         for (String entry : Config.getPref().getList("lorem_ipsum")) {
-            assertTrue(entry + "\nnot found in:\n" + xml, xml.contains(entry));
+            assertTrue(xml.contains(entry), entry + "\nnot found in:\n" + xml);
         }
 
@@ -66,5 +66,5 @@
         assertTrue(xml.contains("<preferences operation=\"append\">"));
         for (String entry : Config.getPref().getList("test")) {
-            assertTrue(entry + "\nnot found in:\n" + xml, xml.contains(entry));
+            assertTrue(xml.contains(entry), entry + "\nnot found in:\n" + xml);
         }
 
@@ -77,5 +77,5 @@
      */
     @Test
-    public void testReadXML() throws IOException {
+    void testReadXML() throws IOException {
         // Test 1 - read(dir, file) + append
         Config.getPref().putList("test", Collections.<String>emptyList());
@@ -83,5 +83,5 @@
         CustomConfigurator.readXML(TestUtils.getTestDataRoot() + "customconfigurator", "append.xml");
         String log = PreferencesUtils.getLog();
-        assertFalse(log, log.contains("Error"));
+        assertFalse(log.contains("Error"), log);
         assertEquals(Arrays.asList("11111111", "2222222", "JOSM"), Config.getPref().getList("test"));
 
@@ -94,5 +94,5 @@
         CustomConfigurator.readXML(new File(TestUtils.getTestDataRoot() + "customconfigurator", "replace.xml"), pref);
         log = PreferencesUtils.getLog();
-        assertFalse(log, log.contains("Error"));
+        assertFalse(log.contains("Error"), log);
         assertEquals(9, pref.getList("lorem_ipsum").size());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+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.assertTrue;
 
 import java.awt.GraphicsEnvironment;
@@ -14,6 +14,6 @@
 import javax.swing.JPanel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.UserIdentityManager;
@@ -32,10 +32,10 @@
  * Unit tests of {@link DownloadOpenChangesetsTask} class.
  */
-public class DownloadOpenChangesetsTaskTest {
+class DownloadOpenChangesetsTaskTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testAnonymous() {
+    void testAnonymous() {
         TestUtils.assumeWorkingJMockit();
         if (GraphicsEnvironment.isHeadless()) {
@@ -105,5 +105,5 @@
      */
     @Test
-    public void testPartiallyIdentified() {
+    void testPartiallyIdentified() {
         TestUtils.assumeWorkingJMockit();
         if (GraphicsEnvironment.isHeadless()) {
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.OsmPrimitiveType;
@@ -21,10 +21,10 @@
  * Unit tests of {@link DownloadPrimitivesTask} class.
  */
-public class DownloadPrimitivesTaskTest {
+class DownloadPrimitivesTaskTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testDownloadPrimitivesTask() {
+    void testDownloadPrimitivesTask() {
         DataSet ds = new DataSet();
         assertTrue(ds.allPrimitives().isEmpty());
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCellTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCellTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCellTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
@@ -10,6 +10,6 @@
 import javax.swing.JTable;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.AbstractModifiableLayer;
@@ -22,9 +22,9 @@
  * Unit tests of {@link LayerNameAndFilePathTableCell} class.
  */
-public class LayerNameAndFilePathTableCellTest {
+class LayerNameAndFilePathTableCellTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testLayerNameAndFilePathTableCell() {
+    void testLayerNameAndFilePathTableCell() {
         JTable table = new JTable();
         File file = new File("test");
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerInfoTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerInfoTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerInfoTest.java	(revision 17275)
@@ -2,11 +2,12 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.io.File;
 
-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.data.osm.DataSet;
 import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer;
@@ -19,9 +20,9 @@
  * Unit tests of {@link SaveLayerInfo} class.
  */
-public class SaveLayerInfoTest {
+class SaveLayerInfoTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,8 +31,8 @@
      * Test of {@link SaveLayerInfo} class - null case.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL")
-    public void testSaveLayerInfoNull() {
-        new SaveLayerInfo(null);
+    void testSaveLayerInfoNull() {
+        assertThrows(IllegalArgumentException.class, () -> new SaveLayerInfo(null));
     }
 
@@ -40,5 +41,5 @@
      */
     @Test
-    public void testSaveLayerInfoNominal() {
+    void testSaveLayerInfoNominal() {
         File file = new File("test");
         String name = "layername";
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerTaskTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-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.data.osm.DataSet;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -15,9 +16,9 @@
  * Unit tests of {@link SaveLayerTask} class.
  */
-public class SaveLayerTaskTest {
+class SaveLayerTaskTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,8 +27,8 @@
      * Test of {@link SaveLayerTask} class - null case.
      */
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL")
-    public void testSaveLayerTaskNull() {
-        new SaveLayerTask(null, null);
+    void testSaveLayerTaskNull() {
+        assertThrows(IllegalArgumentException.class, () -> new SaveLayerTask(null, null));
     }
 
@@ -36,5 +37,5 @@
      */
     @Test
-    public void testSaveLayerTaskNominal() {
+    void testSaveLayerTaskNominal() {
         assertNotNull(new SaveLayerTask(new SaveLayerInfo(new OsmDataLayer(new DataSet(), "", null)), null));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayersDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayersDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayersDialogTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -13,6 +13,6 @@
 import javax.swing.JOptionPane;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -25,10 +25,10 @@
  * Unit tests of {@link SaveLayersDialog} class.
  */
-public class SaveLayersDialogTest {
+class SaveLayersDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -38,5 +38,5 @@
      */
     @Test
-    public void testConfirmSaveLayerInfosOK() {
+    void testConfirmSaveLayerInfosOK() {
         final List<SaveLayerInfo> list = Collections.singletonList(new SaveLayerInfo(new OsmDataLayer(new DataSet(), null, null)));
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/TagSettingsPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/TagSettingsPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/TagSettingsPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link TagSettingsPanel} class.
  */
-public class TagSettingsPanelTest {
+class TagSettingsPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testTagSettingsPanel() {
+    void testTagSettingsPanel() {
         assertNotNull(new TagSettingsPanel(new ChangesetCommentModel(), new ChangesetCommentModel(), new ChangesetReviewModel()));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/UploadAndSaveProgressRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/UploadAndSaveProgressRendererTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/UploadAndSaveProgressRendererTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.beans.PropertyChangeEvent;
@@ -9,6 +9,6 @@
 import javax.swing.JPanel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.io.SaveLayersModel.Mode;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -19,10 +19,10 @@
  * Unit tests of {@link UploadAndSaveProgressRenderer} class.
  */
-public class UploadAndSaveProgressRendererTest {
+class UploadAndSaveProgressRendererTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testUploadAndSaveProgressRenderer() {
+    void testUploadAndSaveProgressRenderer() {
         JPanel parent = new JPanel();
         UploadAndSaveProgressRenderer r = new UploadAndSaveProgressRenderer();
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/UploadDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/UploadDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/UploadDialogTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.GraphicsEnvironment;
@@ -17,6 +17,6 @@
 import javax.swing.JOptionPane;
 
-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.TestUtils;
 import org.openstreetmap.josm.gui.io.UploadDialog.UploadAction;
@@ -31,10 +31,10 @@
  * Unit tests of {@link UploadDialog} class.
  */
-public class UploadDialogTest {
+class UploadDialogTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -43,7 +43,4 @@
         private final String source;
         private final String comment;
-
-        public int handleMissingCommentCalls;
-        public int handleMissingSourceCalls;
 
         MockUploadDialog(final String comment, final String source) {
@@ -64,10 +61,8 @@
         @Override
         public void handleMissingSource() {
-            this.handleMissingSourceCalls += 1;
         }
 
         @Override
         public void handleMissingComment() {
-            this.handleMissingCommentCalls += 1;
         }
 
@@ -107,5 +102,5 @@
      */
     @Test
-    public void testCancelAction() {
+    void testCancelAction() {
         if (GraphicsEnvironment.isHeadless()) {
             TestUtils.assumeWorkingJMockit();
@@ -120,5 +115,5 @@
      */
     @Test
-    public void testIsUploadCommentTooShort() {
+    void testIsUploadCommentTooShort() {
         assertTrue(UploadDialog.UploadAction.isUploadCommentTooShort(""));
         assertTrue(UploadDialog.UploadAction.isUploadCommentTooShort("test"));
@@ -147,5 +142,5 @@
      */
     @Test
-    public void testGetLastChangesetCommentFromHistory() {
+    void testGetLastChangesetCommentFromHistory() {
         doTestGetLastChangesetTagFromHistory(
                 BasicUploadSettingsPanel.HISTORY_KEY,
@@ -158,5 +153,5 @@
      */
     @Test
-    public void testGetLastChangesetSourceFromHistory() {
+    void testGetLastChangesetSourceFromHistory() {
         doTestGetLastChangesetTagFromHistory(
                 BasicUploadSettingsPanel.SOURCE_HISTORY_KEY,
@@ -196,5 +191,5 @@
      */
     @Test
-    public void testValidateUploadTag() {
+    void testValidateUploadTag() {
         doTestValidateUploadTag("upload.comment");
         doTestValidateUploadTag("upload.source");
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link UploadParameterSummaryPanel} class.
  */
-public class UploadParameterSummaryPanelTest {
+class UploadParameterSummaryPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUploadParameterSummaryPanel() {
+    void testUploadParameterSummaryPanel() {
         assertNotNull(new UploadParameterSummaryPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/UploadPrimitivesTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/UploadPrimitivesTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/UploadPrimitivesTaskTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -17,10 +17,10 @@
  * Unit tests of {@link UploadPrimitivesTask} class.
  */
-public class UploadPrimitivesTaskTest {
+class UploadPrimitivesTaskTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testUploadPrimitivesTask() {
+    void testUploadPrimitivesTask() {
         assertNotNull(new UploadPrimitivesTask(
                 new UploadStrategySpecification(),
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -15,10 +15,10 @@
  * Unit tests of {@link UploadStrategySelectionPanel} class.
  */
-public class UploadStrategySelectionPanelTest {
+class UploadStrategySelectionPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testUploadStrategySelectionPanel() {
+    void testUploadStrategySelectionPanel() {
         UploadStrategySelectionPanel p = new UploadStrategySelectionPanel();
         p.setNumUploadedObjects(Integer.MAX_VALUE);
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testUploadStrategySpecification() {
+    void testUploadStrategySpecification() {
         UploadStrategySelectionPanel p = new UploadStrategySelectionPanel();
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/UploadTextComponentValidatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/UploadTextComponentValidatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/UploadTextComponentValidatorTest.java	(revision 17275)
@@ -8,16 +8,16 @@
 import javax.swing.JTextField;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
 
-public class UploadTextComponentValidatorTest {
+class UploadTextComponentValidatorTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testUploadCommentValidator() {
+    void testUploadCommentValidator() {
         JTextField textField = new JTextField();
         JLabel feedback = new JLabel();
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testUploadSourceValidator() {
+    void testUploadSourceValidator() {
         JTextField textField = new JTextField();
         JLabel feedback = new JLabel();
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.io;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link UploadedObjectsSummaryPanel} class.
  */
-public class UploadedObjectsSummaryPanelTest {
+class UploadedObjectsSummaryPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUploadedObjectsSummaryPanel() {
+    void testUploadedObjectsSummaryPanel() {
         assertNotNull(new UploadedObjectsSummaryPanel());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/JpgImporterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/JpgImporterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/JpgImporterTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.io.importexport;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.File;
@@ -11,6 +11,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -21,10 +21,10 @@
  * Unit tests of {@link JpgImporter} class.
  */
-public class JpgImporterTest {
+class JpgImporterTest {
 
     /**
      * Setup test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testTicket14868() throws IOException {
+    void testTicket14868() throws IOException {
         List<File> files = new ArrayList<>();
         JpgImporter.addRecursiveFiles(files, new HashSet<>(), Arrays.asList(
Index: trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/NoteImporterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/NoteImporterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/io/importexport/NoteImporterTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.io.importexport;
 
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -16,10 +16,10 @@
  * Unit tests of {@link NoteImporter} class.
  */
-public class NoteImporterTest {
+class NoteImporterTest {
 
     /**
      * Use the test rules to remove any layers and reset state.
      */
-    @Rule
+    @RegisterExtension
     public final JOSMTestRules rules = new JOSMTestRules();
 
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testTicket12531() {
+    void testTicket12531() {
         MainApplication.getLayerManager().resetState();
         assertNull(MainApplication.getMap());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractMapViewPaintableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractMapViewPaintableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractMapViewPaintableTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationListener;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -19,9 +19,9 @@
  * @author Michael Zangl
  */
-public class AbstractMapViewPaintableTest {
+class AbstractMapViewPaintableTest {
     /**
      * No special test rules
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -32,5 +32,5 @@
      * Create test layer
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         testLayer = new LayerManagerTest.TestLayer();
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testInvalidate() {
+    void testInvalidate() {
         AtomicBoolean fired = new AtomicBoolean();
         PaintableInvalidationListener listener = l -> fired.set(true);
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.Point;
@@ -12,7 +12,7 @@
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -39,10 +39,10 @@
  * Test of the base {@link AbstractTileSourceLayer} class
  */
-public class AbstractTileSourceLayerTest {
+class AbstractTileSourceLayerTest {
 
     /**
      * Setup test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().main();
@@ -148,5 +148,5 @@
      * Create test layer
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));
@@ -159,5 +159,5 @@
      */
     @Test
-    public void testFilterChanged() {
+    void testFilterChanged() {
         try {
             ImageryFilterSettings filterSettings = new ImageryFilterSettings();
@@ -175,5 +175,5 @@
      */
     @Test
-    public void testClearTileCache() {
+    void testClearTileCache() {
         testLayer.loadAllTiles(true);
         assertTrue(testLayer.getTileCache().getTileCount() > 0);
@@ -186,5 +186,5 @@
      */
     @Test
-    public void testGetAdjustAction() {
+    void testGetAdjustAction() {
         assertNotNull(testLayer.getAdjustAction());
     }
@@ -194,5 +194,5 @@
      */
     @Test
-    public void testGetInfoComponent() {
+    void testGetInfoComponent() {
         assertNotNull(testLayer.getInfoComponent());
     }
@@ -202,5 +202,5 @@
      */
     @Test
-    public void testTileSourceLayerPopup() {
+    void testTileSourceLayerPopup() {
         assertNotNull(testLayer.new TileSourceLayerPopup(100, 100));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.io.BufferedWriter;
@@ -21,7 +21,7 @@
 import java.util.List;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -36,9 +36,9 @@
  * Unit tests for class {@link AutosaveTask}.
  */
-public class AutosaveTaskTest {
+class AutosaveTaskTest {
     /**
      * We need preferences and a home directory for this.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
@@ -50,5 +50,5 @@
      * @throws IOException if autosave directory cannot be created
      */
-    @Before
+    @BeforeEach
     public void setUp() throws IOException {
         task = new AutosaveTask();
@@ -59,5 +59,5 @@
      */
     @Test
-    public void testGetUnsavedLayersFilesEmpty() {
+    void testGetUnsavedLayersFilesEmpty() {
         assertTrue(task.getUnsavedLayersFiles().isEmpty());
     }
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testGetUnsavedLayersFilesNotEmpty() throws IOException {
+    void testGetUnsavedLayersFilesNotEmpty() throws IOException {
         Files.createDirectories(task.getAutosaveDir());
         String autodir = task.getAutosaveDir().toString();
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testGetNewLayerFile() throws IOException {
+    void testGetNewLayerFile() throws IOException {
         Files.createDirectories(task.getAutosaveDir());
         AutosaveLayerInfo<?> info = new AutosaveLayerInfo<>(new OsmDataLayer(new DataSet(), "layer", null));
@@ -127,5 +127,5 @@
      */
     @Test
-    public void testScheduleCreatesDirectories() {
+    void testScheduleCreatesDirectories() {
         try {
             task.schedule();
@@ -140,5 +140,5 @@
      */
     @Test
-    public void testAutosaveIgnoresUnmodifiedLayer() {
+    void testAutosaveIgnoresUnmodifiedLayer() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "OsmData", null);
         MainApplication.getLayerManager().addLayer(layer);
@@ -162,5 +162,5 @@
      */
     @Test
-    public void testAutosaveSavesLayer() {
+    void testAutosaveSavesLayer() {
         runAutosaveTaskSeveralTimes(1);
     }
@@ -170,5 +170,5 @@
      */
     @Test
-    public void testAutosaveSavesLayerMultipleTimes() {
+    void testAutosaveSavesLayerMultipleTimes() {
         AutosaveTask.PROP_FILES_PER_LAYER.put(3);
         runAutosaveTaskSeveralTimes(5);
@@ -199,5 +199,5 @@
      */
     @Test
-    public void testDiscardUnsavedLayersIgnoresCurrentInstance() throws IOException {
+    void testDiscardUnsavedLayersIgnoresCurrentInstance() throws IOException {
         runAutosaveTaskSeveralTimes(1);
         try (BufferedWriter file = Files.newBufferedWriter(
@@ -215,5 +215,5 @@
      */
     @Test
-    public void testAutosaveHandlesDuplicateNames() {
+    void testAutosaveHandlesDuplicateNames() {
         DataSet data1 = new DataSet();
         OsmDataLayer layer1 = new OsmDataLayer(data1, "OsmData", null);
@@ -243,5 +243,5 @@
      */
     @Test
-    public void testRecoverLayers() throws Exception {
+    void testRecoverLayers() throws Exception {
         runAutosaveTaskSeveralTimes(1);
         try (BufferedWriter file = Files.newBufferedWriter(
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+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 java.awt.Color;
@@ -16,6 +17,6 @@
 import javax.swing.JScrollPane;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -41,5 +42,5 @@
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection().i18n().metricSystem();
@@ -74,5 +75,5 @@
      */
     @Test
-    public void testGpxLayer() throws Exception {
+    void testGpxLayer() throws Exception {
         GpxLayer layer = new GpxLayer(new GpxData(), "foo", false);
         GpxTrack trk = new GpxTrack(new ArrayList<IGpxTrackSegment>(), new HashMap<>());
@@ -105,5 +106,5 @@
      */
     @Test
-    public void testGetInfoComponent() throws Exception {
+    void testGetInfoComponent() throws Exception {
         assertEquals("<html>\n"+
                      "  <head>\n" +
@@ -192,5 +193,5 @@
      */
     @Test
-    public void testGetTimespanForTrack() throws Exception {
+    void testGetTimespanForTrack() throws Exception {
         assertEquals("", GpxLayer.getTimespanForTrack(
                 new GpxTrack(new ArrayList<Collection<WayPoint>>(), new HashMap<String, Object>())));
@@ -207,5 +208,5 @@
      */
     @Test
-    public void testMergeFrom() throws Exception {
+    void testMergeFrom() throws Exception {
         GpxLayer layer = new GpxLayer(new GpxData());
         assertTrue(layer.data.isEmpty());
@@ -219,7 +220,7 @@
      * Test that {@link GpxLayer#mergeFrom} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testMergeFromIAE() {
-        new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null));
+    @Test
+    void testMergeFromIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null)));
     }
 
@@ -229,5 +230,5 @@
      */
     @Test
-    public void testPaint() throws Exception {
+    void testPaint() throws Exception {
         GpxLayer layer = getMinimalGpxLayer();
         try {
@@ -244,5 +245,5 @@
      */
     @Test
-    public void testGetChangesetSourceTag() {
+    void testGetChangesetSourceTag() {
         assertEquals("survey", new GpxLayer(new GpxData(), "", true).getChangesetSourceTag());
         assertNull(new GpxLayer(new GpxData(), "", false).getChangesetSourceTag());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/ImageryLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/ImageryLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/ImageryLayerTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -15,10 +15,10 @@
  * Unit tests of {@link ImageryLayer} class.
  */
-public class ImageryLayerTest {
+class ImageryLayerTest {
 
     /**
      * For creating layers
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testHasSettings() {
+    void testHasSettings() {
         ImageryLayer layer = TMSLayerTest.createTmsLayer();
         ImageryFilterSettings settings = layer.getFilterSettings();
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerManagerTest.java	(revision 17275)
@@ -4,11 +4,11 @@
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.openstreetmap.josm.testutils.ThrowableRootCauseMatcher.hasRootCause;
@@ -25,6 +25,6 @@
 import javax.swing.Icon;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
@@ -166,5 +166,5 @@
      * Set up test layer manager.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         layerManager = new LayerManager();
@@ -175,5 +175,5 @@
      */
     @Test
-    public void testAddLayer() {
+    void testAddLayer() {
         Layer layer1 = new TestLayer() {
             @Override
@@ -222,5 +222,5 @@
      */
     @Test
-    public void testAddLayerFails() {
+    void testAddLayerFails() {
         Exception e = assertThrows(ReportedException.class, () -> {
             TestLayer layer1 = new TestLayer();
@@ -236,5 +236,5 @@
      */
     @Test
-    public void testAddLayerIllegalPosition() {
+    void testAddLayerIllegalPosition() {
         Exception e = assertThrows(ReportedException.class, () -> {
             TestLayer layer1 = new TestLayer() {
@@ -254,5 +254,5 @@
      */
     @Test
-    public void testRemoveLayer() {
+    void testRemoveLayer() {
         TestLayer layer1 = new TestLayer();
         TestLayer layer2 = new TestLayer();
@@ -275,5 +275,5 @@
      */
     @Test
-    public void testMoveLayer() {
+    void testMoveLayer() {
         TestLayer layer1 = new TestLayer();
         TestLayer layer2 = new TestLayer();
@@ -303,5 +303,5 @@
      */
     @Test
-    public void testMoveLayerFailsRange() {
+    void testMoveLayerFailsRange() {
         Exception e = assertThrows(ReportedException.class, () -> {
             TestLayer layer1 = new TestLayer();
@@ -319,5 +319,5 @@
      */
     @Test
-    public void testMoveLayerFailsNotInList() {
+    void testMoveLayerFailsNotInList() {
         Exception e = assertThrows(ReportedException.class, () -> {
             TestLayer layer1 = new TestLayer();
@@ -333,6 +333,6 @@
      * {@link LayerManager#getLayers()} unmodifiable
      */
-    @Test(expected = UnsupportedOperationException.class)
-    public void testGetLayers() {
+    @Test
+    void testGetLayers() {
         // list should be immutable
         TestLayer layer1 = new TestLayer();
@@ -340,5 +340,5 @@
         layerManager.addLayer(layer1);
         layerManager.addLayer(layer2);
-        layerManager.getLayers().remove(0);
+        assertThrows(UnsupportedOperationException.class, () -> layerManager.getLayers().remove(0));
     }
 
@@ -347,5 +347,5 @@
      */
     @Test
-    public void testGetLayersOfType() {
+    void testGetLayersOfType() {
         TestLayer2 layer1 = new TestLayer2();
         TestLayer2 layer2 = new TestLayer2();
@@ -361,5 +361,5 @@
      */
     @Test
-    public void testContainsLayer() {
+    void testContainsLayer() {
         TestLayer layer = new TestLayer();
         layerManager.addLayer(layer);
@@ -374,5 +374,5 @@
      */
     @Test
-    public void testAddLayerChangeListener() {
+    void testAddLayerChangeListener() {
         CapturingLayerChangeListener l = new CapturingLayerChangeListener();
         layerManager.addLayerChangeListener(l);
@@ -385,9 +385,9 @@
      * {@link LayerManager#addLayerChangeListener(LayerChangeListener)} twice
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testAddLayerChangeListenerDuplicates() {
+    @Test
+    void testAddLayerChangeListenerDuplicates() {
         CapturingLayerChangeListener l = new CapturingLayerChangeListener();
         layerManager.addLayerChangeListener(l);
-        layerManager.addLayerChangeListener(l);
+        assertThrows(IllegalArgumentException.class, () -> layerManager.addLayerChangeListener(l));
     }
 
@@ -396,5 +396,5 @@
      */
     @Test
-    public void testAddLayerChangeListenerFire() {
+    void testAddLayerChangeListenerFire() {
         final ArrayList<Layer> fired = new ArrayList<>();
         TestLayer layer1 = new TestLayer();
@@ -426,5 +426,5 @@
      */
     @Test
-    public void testRemoveLayerChangeListener() {
+    void testRemoveLayerChangeListener() {
         CapturingLayerChangeListener l = new CapturingLayerChangeListener();
         layerManager.addLayerChangeListener(l);
@@ -441,8 +441,8 @@
      * {@link LayerManager#removeLayerChangeListener(LayerChangeListener)} listener not in list
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testRemoveLayerChangeListenerNotAdded() {
-        CapturingLayerChangeListener l = new CapturingLayerChangeListener();
-        layerManager.removeLayerChangeListener(l);
+    @Test
+    void testRemoveLayerChangeListenerNotAdded() {
+        CapturingLayerChangeListener l = new CapturingLayerChangeListener();
+        assertThrows(IllegalArgumentException.class, () -> layerManager.removeLayerChangeListener(l));
     }
 
@@ -451,5 +451,5 @@
      */
     @Test
-    public void testRemoveLayerChangeListenerFire() {
+    void testRemoveLayerChangeListenerFire() {
         final ArrayList<Layer> fired = new ArrayList<>();
         TestLayer layer1 = new TestLayer();
@@ -483,5 +483,5 @@
      */
     @Test
-    public void testLayerRemoveScheduleRemoval() {
+    void testLayerRemoveScheduleRemoval() {
         TestLayer layer1 = new TestLayer();
         TestLayer layer2 = new TestLayer();
@@ -516,5 +516,5 @@
      */
     @Test
-    public void testResetState() {
+    void testResetState() {
         ResetStateChangeListener changeListener = new ResetStateChangeListener();
         layerManager.addLayer(new TestLayer());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerPositionStrategyTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerPositionStrategyTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerPositionStrategyTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test the {@link LayerPositionStrategy} class.
  */
-public class LayerPositionStrategyTest {
+class LayerPositionStrategyTest {
 
     /**
@@ -15,5 +15,5 @@
      */
     @Test
-    public void testNullManager() {
+    void testNullManager() {
         assertEquals(0, LayerPositionStrategy.inFrontOfFirst(l -> true).getPosition(null));
         assertEquals(0, LayerPositionStrategy.afterLast(l -> true).getPosition(null));
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java	(revision 17275)
@@ -2,15 +2,15 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.io.File;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -22,9 +22,9 @@
  * @author Michael Zangl
  */
-public class LayerTest {
+class LayerTest {
     /**
      * We need projection
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
@@ -35,5 +35,5 @@
      * Create test layer
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         testLayer = new LayerManagerTest.TestLayer();
@@ -44,5 +44,5 @@
      */
     @Test
-    public void testIsInfoResizable() {
+    void testIsInfoResizable() {
         assertFalse(testLayer.isInfoResizable());
     }
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testAssociatedFile() {
+    void testAssociatedFile() {
         assertNull(testLayer.getAssociatedFile());
 
@@ -64,5 +64,5 @@
      */
     @Test
-    public void testGetName() {
+    void testGetName() {
         assertEquals("Test Layer", testLayer.getName());
     }
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testSetName() {
+    void testSetName() {
         testLayer.setName("Test Layer2");
         assertEquals("Test Layer2", testLayer.getName());
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testRename() {
+    void testRename() {
         assertFalse(testLayer.isRenamed());
         testLayer.rename("Test Layer2");
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testBackgroundLayer() {
+    void testBackgroundLayer() {
         assertFalse(testLayer.isBackgroundLayer());
         testLayer.setBackgroundLayer(true);
@@ -110,5 +110,5 @@
      */
     @Test
-    public void testVisible() {
+    void testVisible() {
         assertTrue(testLayer.isVisible());
         testLayer.setVisible(false);
@@ -122,5 +122,5 @@
      */
     @Test
-    public void testToggleVisible() {
+    void testToggleVisible() {
         assertTrue(testLayer.isVisible());
         testLayer.toggleVisible();
@@ -134,5 +134,5 @@
      */
     @Test
-    public void testOpacity() {
+    void testOpacity() {
         assertEquals(1, testLayer.getOpacity(), 1e-3);
 
@@ -152,5 +152,5 @@
      */
     @Test
-    public void testIsProjectionSupported() {
+    void testIsProjectionSupported() {
         assertFalse(testLayer.isProjectionSupported(null));
         assertTrue(testLayer.isProjectionSupported(ProjectionRegistry.getProjection()));
@@ -161,5 +161,5 @@
      */
     @Test
-    public void testNameSupportedProjections() {
+    void testNameSupportedProjections() {
         assertNotNull(testLayer.nameSupportedProjections());
     }
@@ -169,5 +169,5 @@
      */
     @Test
-    public void testIsSavable() {
+    void testIsSavable() {
         assertFalse(testLayer.isSavable());
     }
@@ -177,5 +177,5 @@
      */
     @Test
-    public void testCheckSaveConditions() {
+    void testCheckSaveConditions() {
         assertTrue(testLayer.checkSaveConditions());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java	(revision 17275)
@@ -2,13 +2,14 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Arrays;
 
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+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.osm.DataSet;
@@ -21,5 +22,5 @@
  * @author Michael Zangl
  */
-public class MainLayerManagerTest extends LayerManagerTest {
+class MainLayerManagerTest extends LayerManagerTest {
 
     private MainLayerManager layerManagerWithActive;
@@ -54,5 +55,5 @@
     }
 
-    @BeforeClass
+    @BeforeAll
     public static void setUpClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -60,5 +61,5 @@
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() {
         layerManager = layerManagerWithActive = new MainLayerManager();
@@ -66,5 +67,5 @@
 
     @Test
-    public void testAddLayerSetsActiveLayer() {
+    void testAddLayerSetsActiveLayer() {
         TestLayer layer1 = new TestLayer();
         AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer();
@@ -84,5 +85,5 @@
 
     @Test
-    public void testRemoveLayerUnsetsActiveLayer() {
+    void testRemoveLayerUnsetsActiveLayer() {
         TestLayer layer1 = new TestLayer();
         AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer();
@@ -114,5 +115,5 @@
      */
     @Test
-    public void testAddActiveLayerChangeListener() {
+    void testAddActiveLayerChangeListener() {
         TestLayer layer1 = new TestLayer();
         AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer();
@@ -141,9 +142,9 @@
      * Test if {@link MainLayerManager#addActiveLayerChangeListener(ActiveLayerChangeListener)} prevents listener from being added twice.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testAddActiveLayerChangeListenerTwice() {
+    @Test
+    void testAddActiveLayerChangeListenerTwice() {
         CapturingActiveLayerChangeListener listener = new CapturingActiveLayerChangeListener();
         layerManagerWithActive.addActiveLayerChangeListener(listener);
-        layerManagerWithActive.addActiveLayerChangeListener(listener);
+        assertThrows(IllegalArgumentException.class, () -> layerManagerWithActive.addActiveLayerChangeListener(listener));
     }
 
@@ -152,5 +153,5 @@
      */
     @Test
-    public void testRemoveActiveLayerChangeListener() {
+    void testRemoveActiveLayerChangeListener() {
         TestLayer layer1 = new TestLayer();
         AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer();
@@ -169,7 +170,8 @@
      * Test if {@link MainLayerManager#removeActiveLayerChangeListener(ActiveLayerChangeListener)} checks if listener is in list.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testRemoveActiveLayerChangeListenerNotInList() {
-        layerManagerWithActive.removeActiveLayerChangeListener(new CapturingActiveLayerChangeListener());
+    @Test
+    void testRemoveActiveLayerChangeListenerNotInList() {
+        assertThrows(IllegalArgumentException.class,
+                () -> layerManagerWithActive.removeActiveLayerChangeListener(new CapturingActiveLayerChangeListener()));
     }
 
@@ -180,5 +182,5 @@
      */
     @Test
-    public void testSetGetActiveLayer() {
+    void testSetGetActiveLayer() {
         TestLayer layer1 = new TestLayer();
         TestLayer layer2 = new TestLayer();
@@ -197,5 +199,5 @@
      */
     @Test
-    public void testGetEditDataSet() {
+    void testGetEditDataSet() {
         assertNull(layerManagerWithActive.getEditDataSet());
         TestLayer layer0 = new TestLayer();
@@ -219,5 +221,5 @@
      */
     @Test
-    public void testGetVisibleLayersInZOrder() {
+    void testGetVisibleLayersInZOrder() {
         AbstractTestOsmLayer layer1 = new AbstractTestOsmLayer();
         AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer();
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/MapViewPaintableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/MapViewPaintableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/MapViewPaintableTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationEvent;
@@ -12,10 +12,10 @@
  * Unit tests of {@link MapViewPaintable} class.
  */
-public class MapViewPaintableTest {
+class MapViewPaintableTest {
 
     /**
      * Setup tests
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("LayerInvalidationEvent [layer=null]", new PaintableInvalidationEvent(null).toString());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.Collections;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link NativeScaleLayer} class.
  */
-public class NativeScaleLayerTest {
+class NativeScaleLayerTest {
 
     /**
      * Setup tests
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testTicket12255() {
+    void testTicket12255() {
         assertNull(new NativeScaleLayer.ScaleList(Collections.<Double>emptyList()).getSnapScale(10, 2, false));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/NoteLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/NoteLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/NoteLayerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link NoteLayer} class.
  */
-public class NoteLayerTest {
+class NoteLayerTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testTicket13208() {
+    void testTicket13208() {
         assertEquals("0 notes", new NoteLayer().getToolTipText());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testInsertLineBreaks() {
+    void testInsertLineBreaks() {
         // empty string
         assertEquals("", NoteLayer.insertLineBreaks(""));
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testReplaceLinks() {
+    void testReplaceLinks() {
         // empty string
         assertEquals("", NoteLayer.replaceLinks(""));
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.ByteArrayInputStream;
@@ -15,7 +15,7 @@
 import java.util.Iterator;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -46,10 +46,10 @@
  * Unit tests of {@link OsmDataLayer} class.
  */
-public class OsmDataLayerTest {
+class OsmDataLayerTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().main();
@@ -61,5 +61,5 @@
      * Setup tests
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         ds = new DataSet();
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testRecentRelation() {
+    void testRecentRelation() {
         int n = OsmDataLayer.PROPERTY_RECENT_RELATIONS_NUMBER.get();
         assertTrue(n > 0);
@@ -93,5 +93,5 @@
      */
     @Test
-    public void testGetInfoComponent() {
+    void testGetInfoComponent() {
         assertNotNull(layer.getInfoComponent());
 
@@ -130,5 +130,5 @@
      */
     @Test
-    public void testLayerStateChangeListenerNull() {
+    void testLayerStateChangeListenerNull() {
         layer.addLayerStateChangeListener(null);
     }
@@ -138,5 +138,5 @@
      */
     @Test
-    public void testGetIcon() {
+    void testGetIcon() {
         assertNotNull(layer.getIcon());
         layer.setUploadDiscouraged(true);
@@ -148,5 +148,5 @@
      */
     @Test
-    public void testPaint() {
+    void testPaint() {
         fillDataSet(ds);
         assertNotNull(MainApplication.getMap());
@@ -158,5 +158,5 @@
      */
     @Test
-    public void testGetToolTipText() {
+    void testGetToolTipText() {
         assertEquals("<html>0 nodes<br>0 ways<br>0 relations</html>", new OsmDataLayer(ds, "", null).getToolTipText());
         fillDataSet(ds);
@@ -169,5 +169,5 @@
      */
     @Test
-    public void testMergeFrom() {
+    void testMergeFrom() {
         fillDataSet(ds);
         OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), "", null);
@@ -186,5 +186,5 @@
      */
     @Test
-    public void testCleanupAfterUpload() {
+    void testCleanupAfterUpload() {
         fillDataSet(ds);
         assertEquals(6, layer.data.allPrimitives().size());
@@ -197,5 +197,5 @@
      */
     @Test
-    public void testGetMenuEntries() {
+    void testGetMenuEntries() {
         ExpertToggleAction.getInstance().setExpert(true);
         assertEquals(17, layer.getMenuEntries().length);
@@ -210,5 +210,5 @@
      */
     @Test
-    public void testToGpxData() throws IllegalDataException {
+    void testToGpxData() throws IllegalDataException {
         ds.mergeFrom(OsmReader.parseDataSet(new ByteArrayInputStream((
                 "<?xml version='1.0' encoding='UTF-8'?>\n" +
@@ -264,5 +264,5 @@
      */
     @Test
-    public void testContainsPoint() {
+    void testContainsPoint() {
         fillDataSet(ds);
         assertTrue(layer.containsPoint(LatLon.ZERO));
@@ -273,5 +273,5 @@
      */
     @Test
-    public void testIsModified() {
+    void testIsModified() {
         assertFalse(layer.isModified());
         fillDataSet(ds);
@@ -283,5 +283,5 @@
      */
     @Test
-    public void testProjectionChanged() {
+    void testProjectionChanged() {
         layer.projectionChanged(null, null);
     }
@@ -291,5 +291,5 @@
      */
     @Test
-    public void testCheckSaveConditions() {
+    void testCheckSaveConditions() {
         TestUtils.assumeWorkingJMockit();
         final ExtendedDialogMocker edMocker = new ExtendedDialogMocker(
@@ -311,5 +311,5 @@
      */
     @Test
-    public void testLayerNameIncreases() {
+    void testLayerNameIncreases() {
         final OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), OsmDataLayer.createLayerName(147), null);
         final OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null);
@@ -322,5 +322,5 @@
      */
     @Test
-    public void testLayerUnnumberedName() {
+    void testLayerUnnumberedName() {
         final OsmDataLayer layer = new OsmDataLayer(new DataSet(), "Data Layer ", null);
         assertEquals("Data Layer ", layer.getName());
@@ -331,5 +331,5 @@
      */
     @Test
-    public void testLayerNameDoesFinish() {
+    void testLayerNameDoesFinish() {
         final OsmDataLayer layer = new OsmDataLayer(new DataSet(), "Data Layer from GeoJSON: foo.geojson", null);
         assertEquals("Data Layer from GeoJSON: foo.geojson", layer.getName());
@@ -340,5 +340,5 @@
      */
     @Test
-    public void testTicket17065() {
+    void testTicket17065() {
         ClipboardUtils.clear();
         Logging.clearLastErrorAndWarnings();
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-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.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
@@ -21,5 +21,5 @@
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -63,5 +63,5 @@
      */
     @Test
-    public void testTMSLayer() {
+    void testTMSLayer() {
         test(ImageryType.TMS, createTmsLayer());
         test(ImageryType.BING, createBingLayer());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -18,10 +18,10 @@
  * Unit tests of {@link ValidatorLayer} class.
  */
-public class ValidatorLayerTest {
+class ValidatorLayerTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().main();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testValidatorLayer() {
+    void testValidatorLayer() {
         MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));
         ValidatorLayer layer = new ValidatorLayer();
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-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.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
@@ -16,10 +17,10 @@
  * Unit tests of {@link WMSLayer} class.
  */
-public class WMSLayerTest {
+class WMSLayerTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().projection();
@@ -29,5 +30,5 @@
      */
     @Test
-    public void testWMSLayer() {
+    void testWMSLayer() {
         WMSLayer wms = new WMSLayer(new ImageryInfo("test wms", "http://localhost"));
         MainApplication.getLayerManager().addLayer(wms);
@@ -43,7 +44,7 @@
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/13828">Bug #13828</a>.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testTicket13828() {
-        new WMSLayer(new ImageryInfo("TMS", "http://203.159.29.217/try2/{z}/{x}/{y}.png"));
+    @Test
+    void testTicket13828() {
+        assertThrows(IllegalArgumentException.class, () -> new WMSLayer(new ImageryInfo("TMS", "http://203.159.29.217/try2/{z}/{x}/{y}.png")));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.layer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
@@ -15,10 +15,10 @@
  * Unit tests of {@link WMTSLayer} class.
  */
-public class WMTSLayerTest {
+class WMTSLayerTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20000);
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testWMTSLayer() {
+    void testWMTSLayer() {
         WMTSLayer wmts = new WMTSLayer(new ImageryInfo("test wmts", "http://localhost", "wmts", null, null));
         assertEquals(ImageryType.WMTS, wmts.getInfo().getImageryType());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.layer.geoimage;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Collections;
 
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.data.gpx.GpxTimeOffset;
@@ -23,10 +23,10 @@
  * Unit tests of {@link CorrelateGpxWithImages} class.
  */
-public class CorrelateGpxWithImagesTest {
+class CorrelateGpxWithImagesTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         DateUtilsTest.setTimeZone(DateUtils.UTC);
@@ -45,5 +45,5 @@
      */
     @Test
-    public void testAutoGuess() throws Exception {
+    void testAutoGuess() throws Exception {
         final GpxData gpx = GpxReaderTest.parseGpxData("nodist/data/2094047.gpx");
         final ImageEntry i0 = new ImageEntry();
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java	(revision 17275)
@@ -2,6 +2,7 @@
 package org.openstreetmap.josm.gui.layer.geoimage;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.io.File;
@@ -10,6 +11,6 @@
 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.TestUtils;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -26,12 +27,11 @@
  * Unit tests of {@link GeoImageLayer} class.
  */
-public class GeoImageLayerTest {
+class GeoImageLayerTest {
     /**
      * We need prefs for this.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
-
 
     /**
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testLoader() throws Exception {
+    void testLoader() throws Exception {
         try (InputStream in = TestUtils.getRegressionDataStream(12255, "bobrava2.gpx")) {
             GpxReader reader = new GpxReader(in);
@@ -63,7 +63,7 @@
      * Test that {@link GeoImageLayer#mergeFrom} throws IAE for invalid arguments
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testMergeFromIAE() {
-        new GeoImageLayer(null, null).mergeFrom(new OsmDataLayer(new DataSet(), "", null));
+    @Test
+    void testMergeFromIAE() {
+        assertThrows(IllegalArgumentException.class, () -> new GeoImageLayer(null, null).mergeFrom(new OsmDataLayer(new DataSet(), "", null)));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplayTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplayTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplayTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.layer.geoimage;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.awt.Dimension;
 import java.awt.Rectangle;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.layer.geoimage.ImageDisplay.VisRect;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -17,9 +17,9 @@
  * Unit tests of {@link ImageDisplay} class.
  */
-public class ImageDisplayTest {
+class ImageDisplayTest {
     /**
      * We need prefs for this.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testCalculateDrawImageRectangle() {
+    void testCalculateDrawImageRectangle() {
         assertEquals(new Rectangle(),
                 ImageDisplay.calculateDrawImageRectangle(new VisRect(), new Dimension()));
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageEntryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageEntryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageEntryTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.layer.geoimage;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.File;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.gpx.GpxImageEntry;
@@ -16,5 +16,5 @@
  * Unit tests of {@link ImageEntry} class.
  */
-public class ImageEntryTest {
+class ImageEntryTest {
 
     /**
@@ -22,5 +22,5 @@
      */
     @Test
-    public void testTicket12255() {
+    void testTicket12255() {
         ImageEntry e = new ImageEntry(new File(TestUtils.getRegressionDataFile(12255, "G0016941.JPG")));
         e.extractExif();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ImageEntry.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.layer.gpx;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
+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.gui.ExtendedDialog;
@@ -21,10 +21,10 @@
  * Unit tests of {@link ChooseTrackVisibilityAction} class.
  */
-public class ChooseTrackVisibilityActionTest {
+class ChooseTrackVisibilityActionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,6 +35,6 @@
      */
     @Test
-    @Ignore("broken, see #16796")
-    public void testAction() throws Exception {
+    @Disabled("broken, see #16796")
+    void testAction() throws Exception {
         TestUtils.assumeWorkingJMockit();
         final ExtendedDialogMocker edMocker = new ExtendedDialogMocker() {
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.layer.gpx;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.IOException;
@@ -15,6 +15,6 @@
 import java.util.stream.Collectors;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -42,5 +42,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testFromMarkerLayer() throws Exception {
+    void testFromMarkerLayer() throws Exception {
         final GpxData data = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + "minimal.gpx");
         final MarkerLayer markers = new MarkerLayer(data, "Markers", data.storageFile, null);
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testFromTrack() throws Exception {
+    void testFromTrack() throws Exception {
         Config.getPref().put("gpx.convert-tags", "no");
         testFromTrack("tracks.gpx", "tracks.osm");
@@ -138,5 +138,5 @@
                 .collect(Collectors.toList());
 
-        assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", nodesExpected, nodes);
+        assertEquals(nodesExpected, nodes, "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!");
 
         List<String> ways = osm.getWays().stream()
@@ -152,8 +152,8 @@
                 .collect(Collectors.toList());
 
-        assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", waysExpected, ways);
+        assertEquals(waysExpected, ways, "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!");
 
-        assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", osmExpected.allPrimitives().size(),
-                osm.allPrimitives().size());
+        assertEquals(osmExpected.allPrimitives().size(), osm.allPrimitives().size(),
+                "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!");
     }
 
@@ -164,5 +164,5 @@
      */
     @Test
-    public void testTicket14275() throws IOException, SAXException {
+    void testTicket14275() throws IOException, SAXException {
         assertNotNull(GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(14275, "1485101437.8189685.gpx")));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.layer.gpx;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+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 java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -25,10 +25,10 @@
  * Unit tests of {@link DownloadAlongTrackAction} class.
  */
-public class DownloadAlongTrackActionTest {
+class DownloadAlongTrackActionTest {
 
     /**
      * The test rules for this test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testDownload() throws Exception {
+    void testDownload() throws Exception {
         assertNotNull(createTask("minimal.gpx"));
     }
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testDownloadEmpty() throws Exception {
+    void testDownloadEmpty() throws Exception {
         assertNull(createTask("empty.gpx"));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.layer.gpx;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.FileNotFoundException;
@@ -12,6 +12,6 @@
 import java.util.stream.Collectors;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -28,10 +28,10 @@
  * Unit tests of {@link GpxDrawHelper} class.
  */
-public class GpxDrawHelperTest {
+class GpxDrawHelperTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -44,5 +44,5 @@
      */
     @Test
-    public void testTicket12312() throws FileNotFoundException, IOException, SAXException {
+    void testTicket12312() throws FileNotFoundException, IOException, SAXException {
         final Map<String, String> prefs = new HashMap<String, String>() {{
             put("colormode.dynamic-range", "true");
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testNone() throws IOException, SAXException {
+    void testNone() throws IOException, SAXException {
         final List<String> colors = calculateColors("nodist/data/2094047.gpx", Collections.emptyMap(), 10);
         assertEquals("[#000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000]", colors.toString());
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testVelocity() throws IOException, SAXException {
+    void testVelocity() throws IOException, SAXException {
         final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.VELOCITY.toIndex()));
         final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10);
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testVelocityDynamic() throws IOException, SAXException {
+    void testVelocityDynamic() throws IOException, SAXException {
         final Map<String, String> prefs = new HashMap<String, String>() {{
             put("colormode.dynamic-range", "true");
@@ -101,5 +101,5 @@
      */
     @Test
-    public void testDirection() throws IOException, SAXException {
+    void testDirection() throws IOException, SAXException {
         final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.DIRECTION.toIndex()));
         final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10);
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testTime() throws IOException, SAXException {
+    void testTime() throws IOException, SAXException {
         final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.TIME.toIndex()));
         final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10);
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/ColorfulImageProcessorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/ColorfulImageProcessorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/ColorfulImageProcessorTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.layer.imagery;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.Color;
@@ -11,6 +11,6 @@
 import java.awt.image.IndexColorModel;
 
-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.testutils.JOSMTestRules;
 
@@ -21,5 +21,5 @@
  * @author Michael Zangl
  */
-public class ColorfulImageProcessorTest {
+class ColorfulImageProcessorTest {
 
     private static final int TEST_IMAGE_SIZE = 5;
@@ -44,5 +44,5 @@
      * No special rules
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testSetGet() {
+    void testSetGet() {
         ColorfulImageProcessor processor = new ColorfulImageProcessor();
 
@@ -80,5 +80,5 @@
      */
     @Test
-    public void testProcessing() {
+    void testProcessing() {
         for (ConversionData data : new ConversionData[] {
                 new ConversionData(Color.BLACK, 1.5, Color.BLACK),
@@ -114,7 +114,7 @@
             for (int y = 0; y < TEST_IMAGE_SIZE; y++) {
                 Color color = new Color(image.getRGB(x, y));
-                assertEquals(data + ":" + type + ": red", data.getExpectedColor().getRed(), color.getRed(), 1.05);
-                assertEquals(data + ":" + type + ": green", data.getExpectedColor().getGreen(), color.getGreen(), 1.05);
-                assertEquals(data + ":" + type + ": blue", data.getExpectedColor().getBlue(), color.getBlue(), 1.05);
+                assertEquals(data.getExpectedColor().getRed(), color.getRed(), 1.05, data + ":" + type + ": red");
+                assertEquals(data.getExpectedColor().getGreen(), color.getGreen(), 1.05, data + ":" + type + ": green");
+                assertEquals(data.getExpectedColor().getBlue(), color.getBlue(), 1.05, data + ":" + type + ": blue");
             }
         }
@@ -171,5 +171,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         ColorfulImageProcessor processor = new ColorfulImageProcessor();
         assertEquals("ColorfulImageProcessor [colorfulness=1.0]", processor.toString());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/GammaImageProcessorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/GammaImageProcessorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/GammaImageProcessorTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.layer.imagery;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -14,10 +14,10 @@
  * @author Michael Zangl
  */
-public class GammaImageProcessorTest {
+class GammaImageProcessorTest {
 
     /**
      * No special rules
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testSetGet() {
+    void testSetGet() {
         GammaImageProcessor processor = new GammaImageProcessor();
 
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         GammaImageProcessor processor = new GammaImageProcessor();
         assertEquals("GammaImageProcessor [gamma=1.0]", processor.toString());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/SharpenImageProcessorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/SharpenImageProcessorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/SharpenImageProcessorTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.layer.imagery;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -14,10 +14,10 @@
  * @author Michael Zangl
  */
-public class SharpenImageProcessorTest {
+class SharpenImageProcessorTest {
 
     /**
      * No special rules
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testSetGet() {
+    void testSetGet() {
         SharpenImageProcessor processor = new SharpenImageProcessor();
 
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         SharpenImageProcessor processor = new SharpenImageProcessor();
         assertEquals("SharpenImageProcessor [sharpenLevel=1.0]", processor.toString());
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarkerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarkerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarkerTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.layer.markerlayer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.net.MalformedURLException;
 import java.net.URL;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -17,10 +17,10 @@
  * Unit tests of {@link AudioMarker} class.
  */
-public class AudioMarkerTest {
+class AudioMarkerTest {
 
     /**
      * Setup tests
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testAudioMarker() throws MalformedURLException {
+    void testAudioMarker() throws MalformedURLException {
         URL url = new URL("file://something.wav");
         AudioMarker marker = new AudioMarker(
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.layer.markerlayer;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.net.MalformedURLException;
 import java.net.URL;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -17,10 +17,10 @@
  * Unit tests of {@link ImageMarker} class.
  */
-public class ImageMarkerTest {
+class ImageMarkerTest {
 
     /**
      * Setup tests
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testImageMarker() throws MalformedURLException {
+    void testImageMarker() throws MalformedURLException {
         ImageMarker marker = new ImageMarker(
                 LatLon.ZERO,
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 17275)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.gui.layer.markerlayer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+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.assertTrue;
 
 import java.util.Arrays;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -29,10 +29,10 @@
  * Unit tests of {@link MarkerLayer} class.
  */
-public class MarkerLayerTest {
+class MarkerLayerTest {
 
     /**
      * For creating layers
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().preferences().projection();
@@ -41,5 +41,5 @@
      * Setup tests
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         Config.getPref().putBoolean("marker.traceaudio", true);
@@ -50,5 +50,5 @@
      */
     @Test
-    public void testMarkerLayer() {
+    void testMarkerLayer() {
         MarkerLayer layer = new MarkerLayer(new GpxData(), "foo", null, null);
         MainApplication.getLayerManager().addLayer(layer);
@@ -83,5 +83,5 @@
      */
     @Test
-    public void testPlayHeadMarker() {
+    void testPlayHeadMarker() {
         try {
             MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarkerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarkerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarkerTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.layer.markerlayer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -14,10 +14,10 @@
  * Unit tests of {@link PlayHeadMarker} class.
  */
-public class PlayHeadMarkerTest {
+class PlayHeadMarkerTest {
 
     /**
      * Setup tests
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testPlayHeadMarker() {
+    void testPlayHeadMarker() {
         PlayHeadMarker marker = PlayHeadMarker.create();
         assertNotNull(marker);
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/WebMarkerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/WebMarkerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/WebMarkerTest.java	(revision 17275)
@@ -25,5 +25,5 @@
  * Unit tests of {@link WebMarker} class.
  */
-public class WebMarkerTest {
+class WebMarkerTest {
 
     /**
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testWebMarker(@Injectable final PlatformHook mockPlatformHook,
+    void testWebMarker(@Injectable final PlatformHook mockPlatformHook,
                               @Mocked final PlatformManager platformManager) throws Exception {
         TestUtils.assumeWorkingJMockit();
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/AllMappaintTests.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/AllMappaintTests.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/AllMappaintTests.java	(revision 17275)
@@ -15,5 +15,5 @@
     AllMapCSSTests.class
 })
-public class AllMappaintTests {
+class AllMappaintTests {
 
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategyTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategyTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategyTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.mappaint;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.util.Arrays;
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy;
@@ -22,10 +22,10 @@
  * Unit tests of {@link LabelCompositionStrategy}.
  */
-public class LabelCompositionStrategyTest {
+class LabelCompositionStrategyTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testCreateStaticLabelCompositionStrategy() {
+    void testCreateStaticLabelCompositionStrategy() {
         Node n = new Node();
 
@@ -49,5 +49,5 @@
      */
     @Test
-    public void testCreateTagLookupCompositionStrategy() {
+    void testCreateTagLookupCompositionStrategy() {
         Node n = new Node();
         n.put("my-tag", "my-value");
@@ -67,5 +67,5 @@
      */
     @Test
-    public void testCreateDeriveLabelFromNameTagsCompositionStrategy() {
+    void testCreateDeriveLabelFromNameTagsCompositionStrategy() {
         DeriveLabelFromNameTagsCompositionStrategy strat = new DeriveLabelFromNameTagsCompositionStrategy();
         strat.setNameTags(null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.mappaint;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+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.assertTrue;
 
 import java.awt.Color;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.TagKeyReference;
@@ -23,10 +23,10 @@
  * Extended text directives tests.
  */
-public class MapCSSWithExtendedTextDirectivesTest {
+class MapCSSWithExtendedTextDirectivesTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testCreateAutoTextElement() {
+    void testCreateAutoTextElement() {
         MultiCascade mc = new MultiCascade();
         Cascade c = mc.getOrCreateCascade("default");
@@ -53,5 +53,5 @@
      */
     @Test
-    public void testCreateTextElementComposingTextFromTag() {
+    void testCreateTextElementComposingTextFromTag() {
         MultiCascade mc = new MultiCascade();
         Cascade c = mc.getOrCreateCascade("default");
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testCreateNullStrategy() {
+    void testCreateNullStrategy() {
         MultiCascade mc = new MultiCascade();
         Node osm = new Node();
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/RenderingCLIAreaTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/RenderingCLIAreaTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/RenderingCLIAreaTest.java	(revision 17275)
@@ -12,6 +12,6 @@
 import org.hamcrest.CoreMatchers;
 import org.hamcrest.Matcher;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -26,9 +26,9 @@
  */
 @RunWith(Parameterized.class)
-public class RenderingCLIAreaTest {
+class RenderingCLIAreaTest {
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().territories();
@@ -153,5 +153,5 @@
     private final Matcher<Bounds> boundsMatcher;
 
-    public RenderingCLIAreaTest(String args, Matcher<Double> scaleMatcher, Matcher<Bounds> boundsMatcher) {
+    RenderingCLIAreaTest(String args, Matcher<Double> scaleMatcher, Matcher<Bounds> boundsMatcher) {
         this.args = args.split("\\s+", -1);
         this.scaleMatcher = scaleMatcher;
@@ -160,5 +160,5 @@
 
     @Test
-    public void testDetermineRenderingArea() {
+    void testDetermineRenderingArea() {
         RenderingCLI cli = new RenderingCLI();
         cli.parseArguments(args);
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.nio.file.Files;
@@ -10,8 +10,8 @@
 import java.util.Arrays;
 
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -32,5 +32,5 @@
  * Unit tests of {@link ChildOrParentSelector}.
  */
-public class ChildOrParentSelectorTest {
+class ChildOrParentSelectorTest {
 
     private DataSet ds;
@@ -39,5 +39,5 @@
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -46,5 +46,5 @@
      * Setup test
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         ds = new DataSet();
@@ -78,5 +78,5 @@
 
     @Test
-    @Ignore
+    @Disabled
     public void matches_1() {
         String css = "relation >[role=\"my_role\"] node {}";
@@ -92,5 +92,5 @@
 
     @Test
-    @Ignore
+    @Disabled
     public void matches_2() {
         String css = "relation >[\"my_role\"] node {}";
@@ -106,5 +106,5 @@
 
     @Test
-    @Ignore
+    @Disabled
     public void matches_3() {
         String css = "relation >[!\"my_role\"] node {}";
@@ -120,5 +120,5 @@
 
     @Test
-    @Ignore
+    @Disabled
     public void matches_4() {
         String css = "way < relation {}";
@@ -189,7 +189,8 @@
     /**
      * Test inside/contains selectors (spatial test)
+     * @throws Exception in case of any error
      */
     @Test
-    public void testContains() throws Exception {
+    void testContains() throws Exception {
         ds = OsmReader.parseDataSet(Files.newInputStream(Paths.get("nodist/data/amenity-in-amenity.osm")), null);
         ChildOrParentSelector css = parse("node[tag(\"amenity\") = parent_tag(\"amenity\")] ∈ *[amenity] {}");
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactoryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactoryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactoryTest.java	(revision 17275)
@@ -2,6 +2,8 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.gui.mappaint.mapcss.Condition.Context;
 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op;
@@ -15,10 +17,10 @@
  * Unit tests of {@link ConditionFactory}.
  */
-public class ConditionFactoryTest {
+class ConditionFactoryTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,9 +28,9 @@
     /**
      * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/14368">#14368</a>.
-     * @throws Exception if an error occurs
      */
-    @Test(expected = MapCSSException.class)
-    public void testTicket14368() throws Exception {
-        ConditionFactory.createKeyValueCondition("name", "Rodovia ([A-Z]{2,3}-[0-9]{2,4}", Op.REGEX, Context.PRIMITIVE, false);
+    @Test
+    void testTicket14368() {
+        assertThrows(MapCSSException.class,
+                () -> ConditionFactory.createKeyValueCondition("name", "Rodovia ([A-Z]{2,3}-[0-9]{2,4}", Op.REGEX, Context.PRIMITIVE, false));
     }
 
@@ -38,5 +40,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(PseudoClasses.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+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.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
@@ -24,9 +24,9 @@
  * @author Michael Zangl
  */
-public class ConditionTest {
+class ConditionTest {
     /**
      * We need prefs for nodes.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -40,5 +40,5 @@
      * Set up some useful test data.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         node0 = OsmUtils.createPrimitive("n");
@@ -53,5 +53,5 @@
      */
     @Test
-    public void testKeyValueEq() {
+    void testKeyValueEq() {
         Condition op = ConditionFactory.createKeyValueCondition("k1", "v1", Op.EQ, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testKeyValueEqAsKey() {
+    void testKeyValueEqAsKey() {
         Condition op = ConditionFactory.createKeyValueCondition("k1", "k2", Op.EQ, Context.PRIMITIVE, true);
         assertFalse(op.applies(genEnv(node0)));
@@ -87,5 +87,5 @@
      */
     @Test
-    public void testKeyValueNeq() {
+    void testKeyValueNeq() {
         Condition op = ConditionFactory.createKeyValueCondition("k1", "v1", Op.NEQ, Context.PRIMITIVE, false);
         assertTrue(op.applies(genEnv(node0)));
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testKeyValueGreatherEq() {
+    void testKeyValueGreatherEq() {
         Condition op = ConditionFactory.createKeyValueCondition("f1", "0.2", Op.GREATER_OR_EQUAL, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -113,5 +113,5 @@
      */
     @Test
-    public void testKeyValueGreather() {
+    void testKeyValueGreather() {
         Condition op = ConditionFactory.createKeyValueCondition("f1", "0.2", Op.GREATER, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -126,5 +126,5 @@
      */
     @Test
-    public void testKeyValueLessEq() {
+    void testKeyValueLessEq() {
         Condition op = ConditionFactory.createKeyValueCondition("f1", "0.2", Op.LESS_OR_EQUAL, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -139,5 +139,5 @@
      */
     @Test
-    public void testKeyValueLess() {
+    void testKeyValueLess() {
         Condition op = ConditionFactory.createKeyValueCondition("f1", "0.2", Op.LESS, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -152,5 +152,5 @@
      */
     @Test
-    public void testKeyValueRegex() {
+    void testKeyValueRegex() {
         Condition op = ConditionFactory.createKeyValueCondition("r1", "(ab){2}", Op.REGEX, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -165,5 +165,5 @@
      */
     @Test
-    public void testKeyValueNregex() {
+    void testKeyValueNregex() {
         Condition op = ConditionFactory.createKeyValueCondition("r1", "(ab){2}", Op.NREGEX, Context.PRIMITIVE, false);
         assertTrue(op.applies(genEnv(node0)));
@@ -178,5 +178,5 @@
      */
     @Test
-    public void testKeyValueOneOf() {
+    void testKeyValueOneOf() {
         Condition op = ConditionFactory.createKeyValueCondition("one", "a", Op.ONE_OF, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -191,5 +191,5 @@
      */
     @Test
-    public void testKeyValueBeginsWith() {
+    void testKeyValueBeginsWith() {
         Condition op = ConditionFactory.createKeyValueCondition("c1", "xy", Op.BEGINS_WITH, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -204,5 +204,5 @@
      */
     @Test
-    public void testKeyValueEndsWith() {
+    void testKeyValueEndsWith() {
         Condition op = ConditionFactory.createKeyValueCondition("c1", "xy", Op.ENDS_WITH, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -217,5 +217,5 @@
      */
     @Test
-    public void testKeyValueContains() {
+    void testKeyValueContains() {
         Condition op = ConditionFactory.createKeyValueCondition("c1", "xy", Op.CONTAINS, Context.PRIMITIVE, false);
         assertFalse(op.applies(genEnv(node0)));
@@ -230,5 +230,5 @@
      */
     @Test
-    public void testRegexpKeyValueRegexpCondition() {
+    void testRegexpKeyValueRegexpCondition() {
         Condition op = ConditionFactory.createRegexpKeyRegexpValueCondition("^k", "\\da", Op.REGEX);
         assertFalse(op.applies(genEnv(node0)));
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactoryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactoryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactoryTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -12,10 +12,10 @@
  * Unit tests of {@link ExpressionFactory}.
  */
-public class ExpressionFactoryTest {
+class ExpressionFactoryTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(Functions.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.openstreetmap.josm.data.osm.OsmPrimitiveType.NODE;
 
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -25,10 +25,10 @@
  * Unit tests of {@link Functions}.
  */
-public class FunctionsTest {
+class FunctionsTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testOsmUserName() {
+    void testOsmUserName() {
         assertEquals("<anonymous>", Functions.osm_user_name(new EnvBuilder(NODE).setUser(User.getAnonymous()).build()));
     }
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testOsmUserId() {
+    void testOsmUserId() {
         assertEquals(-1, Functions.osm_user_id(new EnvBuilder(NODE).setUser(User.getAnonymous()).build()));
     }
@@ -76,5 +76,5 @@
      */
     @Test
-    public void testOsmVersion() {
+    void testOsmVersion() {
         assertEquals(0, Functions.osm_version(new EnvBuilder(NODE).build()));
     }
@@ -84,5 +84,5 @@
      */
     @Test
-    public void testOsmChangesetId() {
+    void testOsmChangesetId() {
         assertEquals(0, Functions.osm_changeset_id(new EnvBuilder(NODE).build()));
     }
@@ -92,5 +92,5 @@
      */
     @Test
-    public void testOsmTimestamp() {
+    void testOsmTimestamp() {
         assertEquals(0, Functions.osm_timestamp(new EnvBuilder(NODE).build()));
     }
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testParseFunctions() {
+    void testParseFunctions() {
         assertTrue(Functions.to_boolean("true"));
         assertEquals(1, Functions.to_byte("1"));
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testPref() {
+    void testPref() {
         String key = "Functions.JOSM_pref";
         Config.getPref().put(key, null);
@@ -135,5 +135,5 @@
      */
     @Test
-    public void testPrefColor() {
+    void testPrefColor() {
         String key = "Functions.JOSM_pref";
         String colorKey = NamedColorProperty.NAMED_COLOR_PREFIX + NamedColorProperty.COLOR_CATEGORY_MAPPAINT + ".unknown." + key;
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -26,5 +26,5 @@
  * Unit tests of {@link KeyCondition}.
  */
-public class KeyConditionTest {
+class KeyConditionTest {
 
     private DataSet ds;
@@ -33,5 +33,5 @@
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -40,5 +40,5 @@
      * Setup test
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         ds = new DataSet();
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.StringReader;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -30,5 +30,5 @@
  * Unit tests of {@link KeyValueCondition}.
  */
-public class KeyValueConditionTest {
+class KeyValueConditionTest {
 
     private DataSet ds;
@@ -37,5 +37,5 @@
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -44,5 +44,5 @@
      * Setup test
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         ds = new DataSet();
@@ -114,5 +114,5 @@
 
     @Test
-    public void testKeyRegexValueRegex() throws Exception {
+    void testKeyRegexValueRegex() throws Exception {
         Selector selPos = new MapCSSParser(new StringReader("*[/^source/ =~ /.*,.*/]")).selector();
         Selector selNeg = new MapCSSParser(new StringReader("*[/^source/ !~ /.*,.*/]")).selector();
@@ -129,5 +129,5 @@
 
     @Test
-    public void testValueFive() throws Exception {
+    void testValueFive() throws Exception {
         // ticket #5985
         Selector sel = new MapCSSParser(new StringReader("*[width=5]")).selector();
@@ -137,5 +137,5 @@
 
     @Test
-    public void testValueZero() throws Exception {
+    void testValueZero() throws Exception {
         // ticket #12267
         Selector sel = new MapCSSParser(new StringReader("*[frequency=0]")).selector();
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java	(revision 17275)
@@ -2,9 +2,10 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context.PRIMITIVE;
 
@@ -15,6 +16,6 @@
 
 import org.junit.Assert;
-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.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -46,5 +47,5 @@
  * Unit tests of {@link MapCSSParser}.
  */
-public class MapCSSParserTest {
+class MapCSSParserTest {
 
     protected static Environment getEnvironment(String key, String value) {
@@ -59,10 +60,10 @@
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
 
     @Test
-    public void testDeclarations() throws Exception {
+    void testDeclarations() throws Exception {
         getParser("{ opacity: 0.5; color: rgb(1.0, 0.0, 0.0); }").declaration();
         getParser("{ set tag=value; }").declaration(); //set a tag
@@ -73,5 +74,5 @@
 
     @Test
-    public void testClassCondition() throws Exception {
+    void testClassCondition() throws Exception {
         List<Condition> conditions = ((Selector.GeneralSelector) getParser("way[name=X].highway:closed").selector()).conds;
         assertTrue(conditions.get(0) instanceof SimpleKeyValueCondition);
@@ -83,5 +84,5 @@
 
     @Test
-    public void testPseudoClassCondition() throws Exception {
+    void testPseudoClassCondition() throws Exception {
         Condition c1 = ((Selector.GeneralSelector) getParser("way!:area-style").selector()).conds.get(0);
         Condition c2 = ((Selector.GeneralSelector) getParser("way!:areaStyle").selector()).conds.get(0);
@@ -93,5 +94,5 @@
 
     @Test
-    public void testClassMatching() throws Exception {
+    void testClassMatching() throws Exception {
         MapCSSStyleSource css = new MapCSSStyleSource(
                 "way[highway=footway] { set .path; color: #FF6644; width: 2; }\n" +
@@ -117,5 +118,5 @@
 
     @Test
-    public void testEqualCondition() throws Exception {
+    void testEqualCondition() throws Exception {
         Condition condition = getParser("[surface=paved]").condition(PRIMITIVE);
         assertTrue(condition instanceof SimpleKeyValueCondition);
@@ -127,5 +128,5 @@
 
     @Test
-    public void testNotEqualCondition() throws Exception {
+    void testNotEqualCondition() throws Exception {
         KeyValueCondition condition = (KeyValueCondition) getParser("[surface!=paved]").condition(PRIMITIVE);
         assertEquals(Op.NEQ, condition.op);
@@ -135,5 +136,5 @@
 
     @Test
-    public void testRegexCondition() throws Exception {
+    void testRegexCondition() throws Exception {
         KeyValueCondition condition = (KeyValueCondition) getParser("[surface=~/paved|unpaved/]").condition(PRIMITIVE);
         assertEquals(Op.REGEX, condition.op);
@@ -143,5 +144,5 @@
 
     @Test
-    public void testRegexConditionParenthesis() throws Exception {
+    void testRegexConditionParenthesis() throws Exception {
         KeyValueCondition condition = (KeyValueCondition) getParser("[name =~ /^\\(foo\\)/]").condition(PRIMITIVE);
         assertTrue(condition.applies(getEnvironment("name", "(foo)")));
@@ -151,5 +152,5 @@
 
     @Test
-    public void testNegatedRegexCondition() throws Exception {
+    void testNegatedRegexCondition() throws Exception {
         KeyValueCondition condition = (KeyValueCondition) getParser("[surface!~/paved|unpaved/]").condition(PRIMITIVE);
         assertEquals(Op.NREGEX, condition.op);
@@ -159,5 +160,5 @@
 
     @Test
-    public void testBeginsEndsWithCondition() throws Exception {
+    void testBeginsEndsWithCondition() throws Exception {
         KeyValueCondition condition = (KeyValueCondition) getParser("[foo ^= bar]").condition(PRIMITIVE);
         assertEquals(Op.BEGINS_WITH, condition.op);
@@ -173,5 +174,5 @@
 
     @Test
-    public void testOneOfCondition() throws Exception {
+    void testOneOfCondition() throws Exception {
         Condition condition = getParser("[vending~=stamps]").condition(PRIMITIVE);
         assertTrue(condition.applies(getEnvironment("vending", "stamps")));
@@ -182,5 +183,5 @@
 
     @Test
-    public void testStandardKeyCondition() throws Exception {
+    void testStandardKeyCondition() throws Exception {
         KeyCondition c1 = (KeyCondition) getParser("[ highway ]").condition(PRIMITIVE);
         assertEquals(KeyMatchType.EQ, c1.matchType);
@@ -194,5 +195,5 @@
 
     @Test
-    public void testYesNoKeyCondition() throws Exception {
+    void testYesNoKeyCondition() throws Exception {
         KeyCondition c1 = (KeyCondition) getParser("[oneway?]").condition(PRIMITIVE);
         KeyCondition c2 = (KeyCondition) getParser("[oneway?!]").condition(PRIMITIVE);
@@ -217,5 +218,5 @@
 
     @Test
-    public void testRegexKeyCondition() throws Exception {
+    void testRegexKeyCondition() throws Exception {
         KeyCondition c1 = (KeyCondition) getParser("[/.*:(backward|forward)$/]").condition(PRIMITIVE);
         assertEquals(KeyMatchType.REGEX, c1.matchType);
@@ -227,5 +228,5 @@
 
     @Test
-    public void testRegexKeyValueRegexpCondition() throws Exception {
+    void testRegexKeyValueRegexpCondition() throws Exception {
         RegexpKeyValueRegexpCondition c1 = (RegexpKeyValueRegexpCondition) getParser("[/^name/=~/Test/]").condition(PRIMITIVE);
         assertEquals("^name", c1.keyPattern.pattern());
@@ -236,5 +237,5 @@
 
     @Test
-    public void testNRegexKeyConditionSelector() throws Exception {
+    void testNRegexKeyConditionSelector() throws Exception {
         Selector s1 = getParser("*[sport][tourism != hotel]").selector();
         assertTrue(s1.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar"))));
@@ -247,5 +248,5 @@
 
     @Test
-    public void testKeyKeyCondition() throws Exception {
+    void testKeyKeyCondition() throws Exception {
         KeyValueCondition c1 = (KeyValueCondition) getParser("[foo = *bar]").condition(PRIMITIVE);
         Way w1 = new Way();
@@ -270,5 +271,5 @@
      */
     @Test
-    public void testTagRegex() throws Exception {
+    void testTagRegex() throws Exception {
         DataSet ds = new DataSet();
         Way way1 = TestUtils.newWay("old_ref=A1 ref=A2", new Node(new LatLon(1, 1)), new Node(new LatLon(2, 2)));
@@ -300,5 +301,5 @@
 
     @Test
-    public void testParentTag() throws Exception {
+    void testParentTag() throws Exception {
         Selector c1 = getParser("way[foo] > node[tag(\"foo\")=parent_tag(\"foo\")] {}").child_selector();
         DataSet ds = new DataSet();
@@ -330,5 +331,5 @@
      */
     @Test
-    public void testTrimList() {
+    void testTrimList() {
         List<String> trimmed = Functions.trim_list(Arrays.asList(" A1 ", "A2", " A3", "A4 ", ""));
         assertEquals(4, trimmed.size());
@@ -340,5 +341,5 @@
 
     @Test
-    public void testTicket8568() throws Exception {
+    void testTicket8568() throws Exception {
         MapCSSStyleSource sheet = new MapCSSStyleSource(
                 "way { width: 5; }\n" +
@@ -357,5 +358,5 @@
 
     @Test
-    public void testTicket8071() throws Exception {
+    void testTicket8071() throws Exception {
         MapCSSStyleSource sheet = new MapCSSStyleSource(
                 "*[rcn_ref], *[name] {text: concat(tag(rcn_ref), \" \", tag(name)); }");
@@ -377,5 +378,5 @@
 
     @Test
-    public void testColorNameTicket9191() throws Exception {
+    void testColorNameTicket9191() throws Exception {
         Environment e = new Environment(null, new MultiCascade(), Environment.DEFAULT_LAYER, null);
         getParser("{color: testcolour1#88DD22}").declaration().instructions.get(0).execute(e);
@@ -385,5 +386,5 @@
 
     @Test
-    public void testColorNameTicket9191Alpha() throws Exception {
+    void testColorNameTicket9191Alpha() throws Exception {
         Environment e = new Environment(null, new MultiCascade(), Environment.DEFAULT_LAYER, null);
         getParser("{color: testcolour2#12345678}").declaration().instructions.get(0).execute(e);
@@ -393,10 +394,10 @@
 
     @Test
-    public void testColorParsing() throws Exception {
+    void testColorParsing() throws Exception {
         assertEquals(new Color(0x12, 0x34, 0x56, 0x78), ColorHelper.html2color("#12345678"));
     }
 
     @Test
-    public void testChildSelectorGreaterThanSignIsOptional() throws Exception {
+    void testChildSelectorGreaterThanSignIsOptional() throws Exception {
         assertEquals(
                 getParser("relation[type=route] way[highway]").child_selector().toString(),
@@ -405,5 +406,5 @@
 
     @Test
-    public void testSiblingSelector() throws Exception {
+    void testSiblingSelector() throws Exception {
         ChildOrParentSelector s1 = (Selector.ChildOrParentSelector) getParser(
                 "*[a?][parent_tag(\"highway\")=\"unclassified\"] + *[b?]").child_selector();
@@ -431,5 +432,5 @@
 
     @Test
-    public void testParentTags() throws Exception {
+    void testParentTags() throws Exception {
         DataSet ds = new DataSet();
         Node n = new Node(new LatLon(1, 2));
@@ -458,5 +459,5 @@
 
     @Test
-    public void testSort() throws Exception {
+    void testSort() throws Exception {
         assertEquals(Arrays.asList(new String[] {"alpha", "beta"}), Functions.sort("beta", "alpha"));
         Way way1 = TestUtils.newWay("highway=residential name=Alpha alt_name=Beta ref=\"A9;A8\"", new Node(new LatLon(0.001, 0.001)),
@@ -480,5 +481,5 @@
 
     @Test
-    public void testUniqueValues() throws Exception {
+    void testUniqueValues() throws Exception {
         assertEquals(Arrays.asList(new String[] {"alpha", "beta"}),
                 Functions.uniq("alpha", "alpha", "alpha", "beta"));
@@ -488,5 +489,5 @@
 
     @Test
-    public void testCountRoles() throws Exception {
+    void testCountRoles() throws Exception {
         DataSet ds = new DataSet();
         Way way1 = TestUtils.newWay("highway=residential name=1",
@@ -538,5 +539,5 @@
 
     @Test
-    public void testSiblingSelectorInterpolation() throws Exception {
+    void testSiblingSelectorInterpolation() throws Exception {
         ChildOrParentSelector s1 = (Selector.ChildOrParentSelector) getParser(
                 "*[tag(\"addr:housenumber\") > child_tag(\"addr:housenumber\")][regexp_test(\"even|odd\", parent_tag(\"addr:interpolation\"))]" +
@@ -568,5 +569,5 @@
 
     @Test
-    public void testInvalidBaseSelector() throws Exception {
+    void testInvalidBaseSelector() throws Exception {
         MapCSSStyleSource css = new MapCSSStyleSource("invalid_base[key=value] {}");
         css.loadStyleSource();
@@ -576,5 +577,5 @@
 
     @Test
-    public void testMinMaxFunctions() throws Exception {
+    void testMinMaxFunctions() throws Exception {
         MapCSSStyleSource sheet = new MapCSSStyleSource("* {" +
                 "min_value: min(tag(x), tag(y), tag(z)); " +
@@ -600,5 +601,5 @@
      */
     @Test
-    public void testTicket12549() throws ParseException {
+    void testTicket12549() throws ParseException {
         Condition condition = getParser("[name =~ /^(?i)(?u)fóo$/]").condition(PRIMITIVE);
         assertTrue(condition.applies(getEnvironment("name", "fóo")));
@@ -615,5 +616,5 @@
      */
     @Test
-    public void testTicket17053() {
+    void testTicket17053() {
         MapCSSStyleSource sheet = new MapCSSStyleSource(
             "way {\n" +
@@ -625,5 +626,5 @@
             "}");
         sheet.loadStyleSource();
-        assertTrue(sheet.getErrors().toString(), sheet.getErrors().isEmpty());
+        assertTrue(sheet.getErrors().isEmpty(), sheet.getErrors()::toString);
     }
 
@@ -633,5 +634,5 @@
      */
     @Test
-    public void testZoom() throws ParseException {
+    void testZoom() throws ParseException {
         assertNotNull(getParser("|z12").zoom());
         assertNotNull(getParser("|z12-").zoom());
@@ -642,9 +643,8 @@
     /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/18759">Bug #18759</a>.
-     * @throws ParseException if a parsing error occurs
-     */
-    @Test(expected = IllegalArgumentException.class)
-    public void testZoomIAE() throws ParseException {
-        assertNotNull(getParser("|z16-15").zoom());
+     */
+    @Test
+    void testZoomIAE() {
+        assertThrows(IllegalArgumentException.class, () -> getParser("|z16-15").zoom());
     }
 
@@ -653,5 +653,5 @@
      */
     @Test
-    public void testTicket16183() {
+    void testTicket16183() {
         MapCSSStyleSource sheet = new MapCSSStyleSource(
                 "area:closed:areaStyle ⧉ area:closed:areaStyle {throwOther: \"xxx\";}");
@@ -666,5 +666,5 @@
      */
     @Test
-    public void testTicket19685() {
+    void testTicket19685() {
         MapCSSStyleSource sheet = new MapCSSStyleSource("node:connection:foobar {}");
         sheet.loadStyleSource();
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTestIT.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,10 +13,10 @@
  * Integration tests of {@link MapCSSParser}.
  */
-public class MapCSSParserTestIT {
+class MapCSSParserTestIT {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().https().projection();
@@ -26,6 +26,6 @@
      */
     @Test
-    @Ignore("parsing fails")
-    public void testKothicStylesheets() {
+    @Disabled("parsing fails")
+    void testKothicStylesheets() {
         new MapCSSStyleSource("https://raw.githubusercontent.com/kothic/kothic/master/src/styles/default.mapcss").loadStyleSource();
         new MapCSSStyleSource("https://raw.githubusercontent.com/kothic/kothic/master/src/styles/mapink.mapcss").loadStyleSource();
Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@code ParsingLinkSelector}.
  */
-public class ParsingLinkSelectorTest {
+class ParsingLinkSelectorTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
Index: trunk/test/unit/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBoxTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBoxTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBoxTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.oauth;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import javax.swing.ListCellRenderer;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -15,10 +15,10 @@
  * Unit tests of {@link AuthorizationProcedureComboBox} class.
  */
-public class AuthorizationProcedureComboBoxTest {
+class AuthorizationProcedureComboBoxTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testAuthorizationProcedureComboBox() {
+    void testAuthorizationProcedureComboBox() {
         ListCellRenderer<? super AuthorizationProcedure> r = new AuthorizationProcedureComboBox().getRenderer();
         for (AuthorizationProcedure procedure : AuthorizationProcedure.values()) {
Index: trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.oauth;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests of {@link FullyAutomaticAuthorizationUI} class.
  */
-public class FullyAutomaticAuthorizationUITest {
+class FullyAutomaticAuthorizationUITest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testFullyAutomaticAuthorizationUI() {
+    void testFullyAutomaticAuthorizationUI() {
         assertNotNull(new FullyAutomaticAuthorizationUI("", MainApplication.worker));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.oauth;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link FullyAutomaticPropertiesPanel} class.
  */
-public class FullyAutomaticPropertiesPanelTest {
+class FullyAutomaticPropertiesPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testFullyAutomaticPropertiesPanel() {
+    void testFullyAutomaticPropertiesPanel() {
         assertTrue(new FullyAutomaticPropertiesPanel().getComponentCount() > 0);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.oauth;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests of {@link ManualAuthorizationUI} class.
  */
-public class ManualAuthorizationUITest {
+class ManualAuthorizationUITest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testManualAuthorizationUI() {
+    void testManualAuthorizationUI() {
         assertNotNull(new ManualAuthorizationUI("", MainApplication.worker));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.oauth;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests of {@link SemiAutomaticAuthorizationUI} class.
  */
-public class SemiAutomaticAuthorizationUITest {
+class SemiAutomaticAuthorizationUITest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testSemiAutomaticAuthorizationUI() {
+    void testSemiAutomaticAuthorizationUI() {
         assertNotNull(new SemiAutomaticAuthorizationUI("", MainApplication.worker));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.preferences;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/ToolbarPreferencesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/ToolbarPreferencesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/ToolbarPreferencesTest.java	(revision 17275)
@@ -12,5 +12,5 @@
 
 import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.actions.ActionParameter;
 import org.openstreetmap.josm.actions.ActionParameter.StringActionParameter;
@@ -22,5 +22,5 @@
  * Unit tests of {@link ToolbarPreferences} class.
  */
-public class ToolbarPreferencesTest {
+class ToolbarPreferencesTest {
 
     private static class TestAction extends AbstractAction implements ParameterizedAction {
@@ -58,5 +58,5 @@
 
     @Test
-    public void testCase1() {
+    void testCase1() {
         Map<String, Action> actions = new HashMap<>();
         actions.put("action", new TestAction());
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.advanced;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link AdvancedPreference} class.
  */
-public class AdvancedPreferenceTest {
+class AdvancedPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testAdvancedPreference() {
+    void testAdvancedPreference() {
         assertNotNull(new AdvancedPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new AdvancedPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java	(revision 17275)
@@ -6,6 +6,6 @@
 import javax.swing.JOptionPane;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Preferences;
@@ -18,9 +18,9 @@
  * Unit tests of {@link ExportProfileAction} class.
  */
-public class ExportProfileActionTest {
+class ExportProfileActionTest {
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testAction() {
+    void testAction() {
         TestUtils.assumeWorkingJMockit();
         new JOptionPaneSimpleMocker(Collections.singletonMap(
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ListEditorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ListEditorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ListEditorTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.preferences.advanced;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.advanced.ListEditor.ListSettingTableModel;
@@ -16,10 +16,10 @@
  * Unit tests of {@link ListEditor} class.
  */
-public class ListEditorTest {
+class ListEditorTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testListSettingTableModel() {
+    void testListSettingTableModel() {
         ListSettingTableModel model = new ListSettingTableModel(null);
         assertNotNull(model.getData());
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.gui.preferences.advanced;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
@@ -17,10 +17,10 @@
  * Unit tests of {@link PrefEntry} class.
  */
-public class PrefEntryTest {
+class PrefEntryTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testPrefEntry() {
+    void testPrefEntry() {
         String key = "key";
         StringSetting val = new StringSetting("value");
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(PrefEntry.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.advanced;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -11,6 +11,6 @@
 import javax.swing.JOptionPane;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.ExtendedDialog;
@@ -26,9 +26,9 @@
  * Unit tests of {@link PreferencesTable} class.
  */
-public class PreferencesTableTest {
+class PreferencesTableTest {
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testPreferencesTable() {
+    void testPreferencesTable() {
         TestUtils.assumeWorkingJMockit();
         final JOptionPaneSimpleMocker mocker = new JOptionPaneSimpleMocker();
@@ -75,5 +75,5 @@
      */
     @Test
-    public void testAllSettingsTableModel() {
+    void testAllSettingsTableModel() {
         AllSettingsTableModel model = (AllSettingsTableModel) newTable().getModel();
         assertEquals(1, model.getRowCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.audio;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -13,10 +13,10 @@
  * Unit tests of {@link AudioPreference} class.
  */
-public class AudioPreferenceTest {
+class AudioPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testAudioPreference() {
+    void testAudioPreference() {
         assertNotNull(new AudioPreference.Factory().createPreferenceSetting());
     }
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         Config.getPref().putBoolean("audio.menuinvisible", true);
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new AudioPreference.Factory(), null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.display;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link ColorPreference} class.
  */
-public class ColorPreferenceTest {
+class ColorPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testColorPreference() {
+    void testColorPreference() {
         assertNotNull(new ColorPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ColorPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.display;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link DisplayPreference} class.
  */
-public class DisplayPreferenceTest {
+class DisplayPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testDisplayPreference() {
+    void testDisplayPreference() {
         assertNotNull(new DisplayPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new DisplayPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.display;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link DrawingPreference} class.
  */
-public class DrawingPreferenceTest {
+class DrawingPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testDrawingPreference() {
+    void testDrawingPreference() {
         assertNotNull(new DrawingPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new DrawingPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/GPXPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/GPXPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/GPXPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.display;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link GPXPreference} class.
  */
-public class GPXPreferenceTest {
+class GPXPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testGPXPreference() {
+    void testGPXPreference() {
         assertNotNull(new GPXPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new GPXPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.display;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link LafPreference} class.
  */
-public class LafPreferenceTest {
+class LafPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testLafPreference() {
+    void testLafPreference() {
         assertNotNull(new LafPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new LafPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.display;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link LanguagePreference} class.
  */
-public class LanguagePreferenceTest {
+class LanguagePreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testLanguagePreference() {
+    void testLanguagePreference() {
         assertNotNull(new LanguagePreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new LanguagePreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanelTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.preferences.imagery;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -14,10 +14,10 @@
  * Unit tests of {@link AddTMSLayerPanel} class.
  */
-public class AddTMSLayerPanelTest {
+class AddTMSLayerPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testAddTMSLayerPanel() {
+    void testAddTMSLayerPanel() {
         AddTMSLayerPanel panel = new AddTMSLayerPanel();
         assertEquals("", panel.getImageryInfo().getUrl());
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.imagery;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link AddWMSLayerPanel} class.
  */
-public class AddWMSLayerPanelTest {
+class AddWMSLayerPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testAddWMSLayerPanel() {
+    void testAddWMSLayerPanel() {
         AddWMSLayerPanel panel = new AddWMSLayerPanel();
         assertFalse(panel.isImageryValid());
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanelTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.preferences.imagery;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-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.testutils.JOSMTestRules;
 
@@ -13,10 +14,10 @@
  * Unit tests of {@link AddWMTSLayerPanel} class.
  */
-public class AddWMTSLayerPanelTest {
+class AddWMTSLayerPanelTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -26,5 +27,5 @@
      */
     @Test
-    public void testAddWMTSLayerPanel() {
+    void testAddWMTSLayerPanel() {
         AddWMTSLayerPanel panel = new AddWMTSLayerPanel();
         assertFalse(panel.isImageryValid());
@@ -34,7 +35,7 @@
      * Unit test of {@link AddWMTSLayerPanel#getImageryInfo}.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testGetImageryInfo() {
-        new AddWMTSLayerPanel().getImageryInfo();
+    @Test
+    void testGetImageryInfo() {
+        assertThrows(IllegalArgumentException.class, () -> new AddWMTSLayerPanel().getImageryInfo());
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.preferences.imagery;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.File;
 import java.util.Arrays;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -19,10 +19,10 @@
  * Unit tests of {@link ImageryPreference} class.
  */
-public class ImageryPreferenceTest {
+class ImageryPreferenceTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testImageryPreference() {
+    void testImageryPreference() {
         assertNotNull(new ImageryPreference.Factory().createPreferenceSetting());
     }
@@ -40,5 +40,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         String fileUrl = new File(TestUtils.getTestDataRoot()+"__files/imagery/maps.xml").toURI().toString();
         Config.getPref().putList("imagery.layers.sites", Arrays.asList(fileUrl));
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java	(revision 17275)
@@ -396,5 +396,5 @@
     @ParameterizedTest(name = "{0}")
     @MethodSource("data")
-    public void testImageryEntryValidity(String id, ImageryInfo info) {
+    void testImageryEntryValidity(String id, ImageryInfo info) {
         checkEntry(info);
         assertTrue(errors.isEmpty(), format(errors));
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.map;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link BackupPreference} class.
  */
-public class BackupPreferenceTest {
+class BackupPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testBackupPreference() {
+    void testBackupPreference() {
         assertNotNull(new BackupPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new BackupPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.map;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link MapPaintPreference} class.
  */
-public class MapPaintPreferenceTest {
+class MapPaintPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testMapPaintPreference() {
+    void testMapPaintPreference() {
         assertNotNull(new MapPaintPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new MapPaintPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.preferences.map;
 
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeFalse;
 import static org.junit.Assume.assumeTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -10,7 +10,7 @@
 import java.util.List;
 
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized.Parameters;
@@ -35,5 +35,5 @@
  */
 @RunWith(ParallelParameterized.class)
-public class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
+class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
 
     /**
@@ -48,5 +48,5 @@
      * @throws IOException in case of I/O error
      */
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() throws IOException {
         errorsToIgnore.addAll(TestUtils.getIgnoredErrorMessages(MapPaintPreferenceTestIT.class));
@@ -70,5 +70,5 @@
      * @param source source entry to test
      */
-    public MapPaintPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {
+    MapPaintPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {
         super(source);
     }
@@ -79,5 +79,5 @@
      */
     @Test
-    public void testStyleValidity() throws Exception {
+    void testStyleValidity() throws Exception {
         assumeFalse(isIgnoredSubstring(source.url));
         StyleSource style = MapPaintStyles.addStyle(source);
@@ -108,5 +108,5 @@
         warnings.removeAll(ignoredErrors);
 
-        assertTrue(errors.toString() + '\n' + warnings.toString(), errors.isEmpty() && warnings.isEmpty());
+        assertTrue(errors.isEmpty() && warnings.isEmpty(), errors.toString() + '\n' + warnings.toString());
         assumeTrue(ignoredErrors.toString(), ignoredErrors.isEmpty());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.map;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link MapPreference} class.
  */
-public class MapPreferenceTest {
+class MapPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testMapPreference() {
+    void testMapPreference() {
         assertNotNull(new MapPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new MapPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.map;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link TaggingPresetPreference} class.
  */
-public class TaggingPresetPreferenceTest {
+class TaggingPresetPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testTaggingPresetPreference() {
+    void testTaggingPresetPreference() {
         assertNotNull(new TaggingPresetPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new TaggingPresetPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.map;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeFalse;
 import static org.junit.Assume.assumeTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -15,7 +15,7 @@
 import java.util.Set;
 
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -41,5 +41,5 @@
  */
 @RunWith(Parameterized.class)
-public class TaggingPresetPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
+class TaggingPresetPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
 
     /**
@@ -54,5 +54,5 @@
      * @throws IOException in case of I/O error
      */
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() throws IOException {
         errorsToIgnore.addAll(TestUtils.getIgnoredErrorMessages(TaggingPresetPreferenceTestIT.class));
@@ -81,5 +81,5 @@
      * @param source source entry to test
      */
-    public TaggingPresetPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {
+    TaggingPresetPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {
         super(source);
     }
@@ -90,5 +90,5 @@
      */
     @Test
-    public void testPresetsValidity() throws Exception {
+    void testPresetsValidity() throws Exception {
         assumeFalse(isIgnoredSubstring(source.url));
         Set<String> errors = new HashSet<>();
@@ -106,5 +106,5 @@
             handleException(e, errors);
         }
-        assertTrue(errors.toString(), errors.isEmpty());
+        assertTrue(errors.isEmpty(), errors::toString);
         assumeTrue(ignoredErrors.toString(), ignoredErrors.isEmpty());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.preferences.plugin;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.File;
@@ -10,6 +10,6 @@
 import java.util.Collections;
 
-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.TestUtils;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -18,6 +18,6 @@
 import org.openstreetmap.josm.plugins.PluginException;
 import org.openstreetmap.josm.plugins.PluginInformation;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -30,5 +30,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
@@ -38,5 +38,5 @@
      */
     @Test
-    public void testPluginPreference() {
+    void testPluginPreference() {
         assertNotNull(new PluginPreference.Factory().createPreferenceSetting());
     }
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testBuildDownloadSummary() throws Exception {
+    void testBuildDownloadSummary() throws Exception {
         final PluginInformation dummy = getDummyPluginInformation();
         assertEquals("", PluginPreference.buildDownloadSummary(
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testNotifyDownloadResults() {
+    void testNotifyDownloadResults() {
         final HelpAwareOptionPaneMocker mocker = new HelpAwareOptionPaneMocker();
         mocker.getMockResultMap().put("<html></html>", "OK");  // (buildDownloadSummary() output was empty)
@@ -103,5 +103,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new PluginPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.projection;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link ProjectionPreference} class.
  */
-public class ProjectionPreferenceTest {
+class ProjectionPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testProjectionPreference() {
+    void testProjectionPreference() {
         assertNotNull(new ProjectionPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProjectionPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.remotecontrol;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link RemoteControlPreference} class.
  */
-public class RemoteControlPreferenceTest {
+class RemoteControlPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testRemoteControlPreference() {
+    void testRemoteControlPreference() {
         assertNotNull(new RemoteControlPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new RemoteControlPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.server;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests of {@link ProxyPreference} class.
  */
-public class ProxyPreferenceTest {
+class ProxyPreferenceTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testProxyPreference() {
+    void testProxyPreference() {
         assertNotNull(new ProxyPreference.Factory().createPreferenceSetting());
     }
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProxyPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.server;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -14,10 +14,10 @@
  * Unit tests of {@link ServerAccessPreference} class.
  */
-public class ServerAccessPreferenceTest {
+class ServerAccessPreferenceTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testServerAccessPreference() {
+    void testServerAccessPreference() {
         assertNotNull(new ServerAccessPreference.Factory().createPreferenceSetting());
     }
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.shortcut;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link ShortcutPreference} class.
  */
-public class ShortcutPreferenceTest {
+class ShortcutPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testShortcutPreference() {
+    void testShortcutPreference() {
         assertNotNull(new ShortcutPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ShortcutPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.validator;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link ValidatorPreference} class.
  */
-public class ValidatorPreferenceTest {
+class ValidatorPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testValidatorPreference() {
+    void testValidatorPreference() {
         assertNotNull(new ValidatorPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ValidatorPreference.Factory(), null);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.preferences.validator;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -9,6 +9,6 @@
 import java.util.Collection;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry;
 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;
@@ -21,10 +21,10 @@
  * Integration tests of {@link ValidatorTagCheckerRulesPreference} class.
  */
-public class ValidatorTagCheckerRulesPreferenceTestIT {
+class ValidatorTagCheckerRulesPreferenceTestIT {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().https().timeout(20_000);
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testValidityOfAvailableRules() throws Exception {
+    void testValidityOfAvailableRules() throws Exception {
         Collection<ExtendedSourceEntry> sources = new ValidatorTagCheckerRulesPreference.TagCheckerRulesSourceEditor()
                 .loadAndGetAvailableSources();
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.preferences.validator;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
@@ -12,10 +12,10 @@
  * Unit tests of {@link ValidatorTestsPreference} class.
  */
-public class ValidatorTestsPreferenceTest {
+class ValidatorTestsPreferenceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUpBeforeClass() {
         JOSMFixture.createUnitTestFixture().init();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testValidatorTestsPreference() {
+    void testValidatorTestsPreference() {
         assertNotNull(new ValidatorTestsPreference.Factory().createPreferenceSetting());
     }
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testAddGui() {
+    void testAddGui() {
         PreferencesTestUtils.doTestPreferenceSettingAddGui(new ValidatorTestsPreference.Factory(), ValidatorPreference.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagEditorModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagEditorModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagEditorModelTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.gui.tagging;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link TagEditorModel} class.
  */
-public class TagEditorModelTest {
+class TagEditorModelTest {
 
     /**
@@ -15,5 +15,5 @@
      */
     @Test
-    public void testTagEditorModel() {
+    void testTagEditorModel() {
         TagEditorModel tem = new TagEditorModel();
         tem.add(null, null);
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagModelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/TagModelTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.tagging;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link TagModel} class.
  */
-public class TagModelTest {
+class TagModelTest {
 
     /**
@@ -16,5 +16,5 @@
      */
     @Test
-    public void testTagModelSingleValue() {
+    void testTagModelSingleValue() {
         TagModel tm = new TagModel();
         assertEquals("", tm.getName());
@@ -43,5 +43,5 @@
      */
     @Test
-    public void testTagModelMultipleValues() {
+    void testTagModelMultipleValues() {
         TagModel tm = new TagModel("key2", "val2");
         assertEquals("key2", tm.getName());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManagerTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.tagging.ac;
 
-import org.junit.Rule;
-import org.junit.Test;
+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,10 +17,10 @@
  * Unit tests of {@link AutoCompletionManager} class.
  */
-public class AutoCompletionManagerTest {
+class AutoCompletionManagerTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testTicket17064() {
+    void testTicket17064() {
         DataSet ds = new DataSet();
         OsmDataLayer layer = new OsmDataLayer(ds, "testTicket17064", null);
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(UserInputTag.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/PresetClassificationsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/PresetClassificationsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/PresetClassificationsTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.tagging.presets;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -12,6 +12,6 @@
 import java.util.stream.Collectors;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.Node;
@@ -26,5 +26,5 @@
  * Unit tests of {@link PresetClassifications} class.
  */
-public class PresetClassificationsTest {
+class PresetClassificationsTest {
 
     static final PresetClassifications classifications = new PresetClassifications();
@@ -35,5 +35,5 @@
      * @throws IOException if any I/O error occurs
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() throws IOException, SAXException {
         JOSMFixture.createUnitTestFixture().init();
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testBuilding() {
+    void testBuilding() {
         final Way w = new Way();
         final Node n1 = new Node();
@@ -61,7 +61,7 @@
         w.addNode(new Node());
         w.addNode(new Node());
-        assertFalse("unclosed way should not match building preset", getMatchingPresetNames("building", w).contains("Building"));
+        assertFalse(getMatchingPresetNames("building", w).contains("Building"), "unclosed way should not match building preset");
         w.addNode(n1);
-        assertTrue("closed way should match building preset", getMatchingPresetNames("building", w).contains("Building"));
+        assertTrue(getMatchingPresetNames("building", w).contains("Building"), "closed way should match building preset");
     }
 
@@ -70,11 +70,12 @@
      */
     @Test
-    public void testRelationsForTram() {
+    void testRelationsForTram() {
         final OsmPrimitive tram = OsmUtils.createPrimitive("way railway=tram");
-        assertTrue("railway=tram should match 'Railway Route' for relation creation", getMatchingPresetNames("route", tram)
-                .contains("Railway Route"));
-        assertTrue("railway=tram should match 'Public Transport Route (Rail)' for relation creation", getMatchingPresetNames("route", tram)
-                .contains("Public Transport Route (Rail)"));
-        assertFalse("railway=tram should not match 'Bus'", getMatchingPresetNames("route", tram).toString().contains("Bus"));
+        assertTrue(getMatchingPresetNames("route", tram).contains("Railway Route"),
+                "railway=tram should match 'Railway Route' for relation creation");
+        assertTrue(getMatchingPresetNames("route", tram).contains("Public Transport Route (Rail)"),
+                "railway=tram should match 'Public Transport Route (Rail)' for relation creation");
+        assertFalse(getMatchingPresetNames("route", tram).toString().contains("Bus"),
+                "railway=tram should not match 'Bus'");
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java	(revision 17275)
@@ -4,7 +4,7 @@
 import static org.CustomMatchers.hasSize;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.IOException;
@@ -14,6 +14,6 @@
 
 import org.junit.Assert;
-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.TestUtils;
 import org.openstreetmap.josm.gui.tagging.presets.items.Check;
@@ -27,10 +27,10 @@
  * Unit tests of {@link TaggingPresetReader} class.
  */
-public class TaggingPresetReaderTest {
+class TaggingPresetReaderTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testTicket8954() throws SAXException, IOException {
+    void testTicket8954() throws SAXException, IOException {
         String presetfile = TestUtils.getRegressionDataFile(8954, "preset.xml");
         final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(presetfile, false);
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testNestedChunks() throws SAXException, IOException {
+    void testNestedChunks() throws SAXException, IOException {
         final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(TestUtils.getTestDataRoot() + "preset_chunk.xml", true);
         assertThat(presets, hasSize(1));
@@ -70,7 +70,8 @@
      * Test external entity resolving.
      * See #19286
+     * @throws IOException in case of I/O error
      */
     @Test
-    public void testExternalEntityResolving() throws IOException {
+    void testExternalEntityResolving() throws IOException {
         try {
             TaggingPresetReader.readAll(TestUtils.getTestDataRoot() + "preset_external_entity.xml", true);
@@ -89,5 +90,5 @@
      */
     @Test
-    public void testReadDefaulPresets() throws SAXException, IOException {
+    void testReadDefaulPresets() throws SAXException, IOException {
         String presetfile = "resource://data/defaultpresets.xml";
         final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(presetfile, true);
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelectorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelectorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelectorTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.tagging.presets;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSelector.PresetClassification;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -15,10 +15,10 @@
  * Unit tests of {@link TaggingPresetSelector} class.
  */
-public class TaggingPresetSelectorTest {
+class TaggingPresetSelectorTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testIsMatching() {
+    void testIsMatching() {
         TaggingPreset preset = new TaggingPreset();
         preset.name = "estação de bombeiros"; // fire_station in brazilian portuguese
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetsTest.java	(revision 17275)
@@ -8,6 +8,6 @@
 import java.util.concurrent.TimeoutException;
 
-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.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.Logging;
@@ -24,5 +24,5 @@
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(TaggingPresets.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckGroupTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckGroupTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckGroupTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -10,6 +10,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -18,10 +18,10 @@
  * Unit tests of {@link CheckGroup} class.
  */
-public class CheckGroupTest {
+class CheckGroupTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         CheckGroup cg = new CheckGroup();
         JPanel p = new JPanel();
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -9,6 +9,6 @@
 import javax.swing.JPanel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -19,10 +19,10 @@
  * Unit tests of {@link Check} class.
  */
-public class CheckTest {
+class CheckTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.Color;
@@ -11,6 +11,6 @@
 import javax.swing.JPanel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
@@ -22,10 +22,10 @@
  * Unit tests of {@link Combo} class.
  */
-public class ComboTest {
+class ComboTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().i18n("de");
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testUseLastAsDefault() {
+    void testUseLastAsDefault() {
         Combo combo = new Combo();
         combo.key = "addr:country";
@@ -83,5 +83,5 @@
 
     @Test
-    public void testColor() {
+    void testColor() {
         Combo combo = new Combo();
         combo.key = "colour";
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ItemSeparatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ItemSeparatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ItemSeparatorTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -10,6 +10,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -18,10 +18,10 @@
  * Unit tests of {@link ItemSeparator} class.
  */
-public class ItemSeparatorTest {
+class ItemSeparatorTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/KeyTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/KeyTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/KeyTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
 import java.util.Collections;
@@ -9,6 +9,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -17,10 +17,10 @@
  * Unit tests of {@link Key} class.
  */
-public class KeyTest {
+class KeyTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LabelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LabelTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LabelTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -9,6 +9,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -17,10 +17,10 @@
  * Unit tests of {@link Label} class.
  */
-public class LabelTest {
+class LabelTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LinkTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LinkTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LinkTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -10,6 +10,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -19,10 +19,10 @@
  * Unit tests of {@link Link} class.
  */
-public class LinkTest {
+class LinkTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         Link l = new Link();
         JPanel p = new JPanel();
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -9,6 +9,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -17,10 +17,10 @@
  * Unit tests of {@link MultiSelect} class.
  */
-public class MultiSelectTest {
+class MultiSelectTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/OptionalTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/OptionalTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/OptionalTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -10,6 +10,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -18,10 +18,10 @@
  * Unit tests of {@link Optional} class.
  */
-public class OptionalTest {
+class OptionalTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -10,6 +10,6 @@
 import javax.swing.JPanel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -20,10 +20,10 @@
  * Unit tests of {@link PresetLink} class.
  */
-public class PresetLinkTest {
+class PresetLinkTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rule = new JOSMTestRules().presets();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         PresetLink l = new PresetLink();
         l.preset_name = "River";
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntryTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 
@@ -11,10 +11,10 @@
  * Unit tests of {@link PresetListEntry} class.
  */
-public class PresetListEntryTest {
+class PresetListEntryTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testTicket12416() {
+    void testTicket12416() {
         assertEquals("&nbsp;", new PresetListEntry("").getListDisplay());
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/RolesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/RolesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/RolesTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -10,6 +10,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -18,10 +18,10 @@
  * Unit tests of {@link Roles} class.
  */
-public class RolesTest {
+class RolesTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/SpaceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/SpaceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/SpaceTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -10,6 +10,6 @@
 import javax.swing.JPanel;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -18,10 +18,10 @@
  * Unit tests of {@link Space} class.
  */
-public class SpaceTest {
+class SpaceTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.gui.tagging.presets.items;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
@@ -9,6 +9,6 @@
 import javax.swing.JPanel;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -19,10 +19,10 @@
  * Unit tests of {@link Text} class.
  */
-public class TextTest {
+class TextTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testAddToPanel() {
+    void testAddToPanel() {
         JPanel p = new JPanel();
         assertEquals(0, p.getComponentCount());
Index: trunk/test/unit/org/openstreetmap/josm/gui/util/FileFilterAllFilesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/util/FileFilterAllFilesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/util/FileFilterAllFilesTest.java	(revision 17275)
@@ -2,15 +2,15 @@
 package org.openstreetmap.josm.gui.util;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link FileFilterAllFiles} class.
  */
-public class FileFilterAllFilesTest {
+class FileFilterAllFilesTest {
 
     /**
@@ -18,5 +18,5 @@
      */
     @Test
-    public void testFileFilterAllFiles() {
+    void testFileFilterAllFiles() {
         assertTrue(FileFilterAllFiles.getInstance().accept(new File(".")));
         assertNotNull(FileFilterAllFiles.getInstance().getDescription());
Index: trunk/test/unit/org/openstreetmap/josm/gui/util/MultiLineFlowLayoutTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/util/MultiLineFlowLayoutTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/util/MultiLineFlowLayoutTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.util;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.awt.Dimension;
@@ -10,7 +10,7 @@
 import javax.swing.JPanel;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
 
@@ -21,9 +21,9 @@
  * @author Michael Zangl
  */
-public class MultiLineFlowLayoutTest {
+class MultiLineFlowLayoutTest {
     /**
      * No special rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      * Prepare test container.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         JPanel parent = new JPanel();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testOneLine() {
+    void testOneLine() {
         fillOneLine();
 
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testInsets() {
+    void testInsets() {
         fillOneLine();
 
@@ -86,5 +86,5 @@
      */
     @Test
-    public void testGaps() {
+    void testGaps() {
         fillOneLine();
 
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testSameAsFlowLayout() {
+    void testSameAsFlowLayout() {
         fillOneLine();
         JPanel childx = new JPanel();
Index: trunk/test/unit/org/openstreetmap/josm/gui/util/WindowGeometryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/util/WindowGeometryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/util/WindowGeometryTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.util;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.Dimension;
@@ -14,6 +15,6 @@
 import javax.swing.JPanel;
 
-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.TestUtils;
 import org.openstreetmap.josm.gui.util.WindowGeometry.WindowGeometryException;
@@ -28,9 +29,9 @@
  * Unit tests of {@link WindowGeometry} class.
  */
-public class WindowGeometryTest {
+class WindowGeometryTest {
     /**
      * Some of this depends on preferences.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -40,5 +41,5 @@
      */
     @Test
-    public void testCenterInWindow() {
+    void testCenterInWindow() {
         assertNotNull(WindowGeometry.centerInWindow(null, null));
         assertNotNull(WindowGeometry.centerInWindow(new JPanel(), null));
@@ -49,5 +50,5 @@
      */
     @Test
-    public void testCenterOnScreen() {
+    void testCenterOnScreen() {
         Dimension dim = new Dimension(200, 100);
         assertEquals(new WindowGeometry(new Point(0, 0), dim), WindowGeometry.centerOnScreen(dim));
@@ -60,40 +61,36 @@
     /**
      * Test of {@link WindowGeometry.WindowGeometryException} class.
-     * @throws WindowGeometryException always
      */
-    @Test(expected = WindowGeometryException.class)
-    public void testWindowGeometryException1() throws WindowGeometryException {
+    @Test
+    void testWindowGeometryException1() {
         Config.getPref().put("test", null);
-        new WindowGeometry("test");
+        assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test"));
     }
 
     /**
      * Test of {@link WindowGeometry.WindowGeometryException} class.
-     * @throws WindowGeometryException always
      */
-    @Test(expected = WindowGeometryException.class)
-    public void testWindowGeometryException2() throws WindowGeometryException {
+    @Test
+    void testWindowGeometryException2() {
         Config.getPref().put("test", "");
-        new WindowGeometry("test");
+        assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test"));
     }
 
     /**
      * Test of {@link WindowGeometry.WindowGeometryException} class.
-     * @throws WindowGeometryException always
      */
-    @Test(expected = WindowGeometryException.class)
-    public void testWindowGeometryException3() throws WindowGeometryException {
+    @Test
+    void testWindowGeometryException3() {
         Config.getPref().put("test", "x=not_a_number");
-        new WindowGeometry("test");
+        assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test"));
     }
 
     /**
      * Test of {@link WindowGeometry.WindowGeometryException} class.
-     * @throws WindowGeometryException always
      */
-    @Test(expected = WindowGeometryException.class)
-    public void testWindowGeometryException4() throws WindowGeometryException {
+    @Test
+    void testWindowGeometryException4() {
         Config.getPref().put("test", "wrong_pattern");
-        new WindowGeometry("test");
+        assertThrows(WindowGeometryException.class, () -> new WindowGeometry("test"));
     }
 
@@ -103,5 +100,5 @@
      */
     @Test
-    public void testWindowGeometryException5() throws WindowGeometryException {
+    void testWindowGeometryException5() throws WindowGeometryException {
         Config.getPref().put("test", "x=15,y=55,width=200,height=100");
         assertNotNull(new WindowGeometry("test"));
@@ -112,5 +109,5 @@
      */
     @Test
-    public void testIsBugInMaximumWindowBounds() {
+    void testIsBugInMaximumWindowBounds() {
         assertFalse(WindowGeometry.isBugInMaximumWindowBounds(new Rectangle(10, 10)));
         assertTrue(WindowGeometry.isBugInMaximumWindowBounds(new Rectangle(10, 0)));
@@ -122,5 +119,5 @@
      */
     @Test
-    public void testGetVirtualScreenBounds() {
+    void testGetVirtualScreenBounds() {
         assertNotNull(WindowGeometry.getVirtualScreenBounds());
     }
@@ -130,5 +127,5 @@
      */
     @Test
-    public void testGetMaxDimensionOnScreen() {
+    void testGetMaxDimensionOnScreen() {
         assertNotNull(WindowGeometry.getMaxDimensionOnScreen(new JLabel()));
     }
@@ -138,5 +135,5 @@
      */
     @Test
-    public void testToString() {
+    void testToString() {
         assertEquals("WindowGeometry{topLeft=java.awt.Point[x=0,y=0],extent=java.awt.Dimension[width=0,height=0]}",
                 new WindowGeometry(new Rectangle()).toString());
@@ -147,5 +144,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(WindowGeometry.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/gui/widgets/AutoAdjustingSplitPaneTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/widgets/AutoAdjustingSplitPaneTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/gui/widgets/AutoAdjustingSplitPaneTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.gui.widgets;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.beans.PropertyChangeEvent;
@@ -8,6 +8,6 @@
 import javax.swing.JSplitPane;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -17,10 +17,10 @@
  * Unit tests of {@link AutoAdjustingSplitPane} class.
  */
-public class AutoAdjustingSplitPaneTest {
+class AutoAdjustingSplitPaneTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testAutoAdjustingSplitPane() {
+    void testAutoAdjustingSplitPane() {
         AutoAdjustingSplitPane pane = new AutoAdjustingSplitPane(JSplitPane.VERTICAL_SPLIT);
         assertEquals(-1, pane.getDividerLocation());
Index: trunk/test/unit/org/openstreetmap/josm/io/CapabilitiesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/CapabilitiesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/CapabilitiesTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.InputStream;
@@ -11,5 +11,5 @@
 import java.util.Collections;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.xml.sax.InputSource;
@@ -18,5 +18,5 @@
  * Unit tests of {@link Capabilities} class.
  */
-public class CapabilitiesTest {
+class CapabilitiesTest {
 
     /**
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testCapabilities() throws Exception {
+    void testCapabilities() throws Exception {
         final Path path = Paths.get(TestUtils.getTestDataRoot(), "__files/api/0.6/capabilities");
         final Capabilities capabilities;
Index: trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.io;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -12,10 +12,10 @@
  * Unit tests of {@link CertificateAmendment} class.
  */
-public class CertificateAmendmentTest {
+class CertificateAmendmentTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(CertificateAmendment.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java	(revision 17275)
@@ -13,7 +13,7 @@
 
 import org.junit.Assert;
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -24,5 +24,5 @@
  * Integration tests of {@link CertificateAmendment} class.
  */
-public class CertificateAmendmentTestIT {
+class CertificateAmendmentTestIT {
 
     /**
@@ -39,5 +39,5 @@
      * @throws IOException in case of I/O error
      */
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() throws IOException {
         errorsToIgnore.addAll(TestUtils.getIgnoredErrorMessages(CertificateAmendmentTestIT.class));
@@ -49,5 +49,5 @@
      */
     @Test
-    public void testDefault() throws IOException {
+    void testDefault() throws IOException {
         // something that is not embedded
         connect("https://www.bing.com", true);
@@ -59,5 +59,5 @@
      */
     @Test
-    public void testLetsEncrypt() throws IOException {
+    void testLetsEncrypt() throws IOException {
         // signed by letsencrypt's own ISRG root
         connect("https://valid-isrgrootx1.letsencrypt.org", true);
@@ -73,5 +73,5 @@
      */
     @Test
-    public void testOverpass() throws IOException {
+    void testOverpass() throws IOException {
         connect("https://overpass-api.de", true);
     }
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testDutchGovernment() throws IOException {
+    void testDutchGovernment() throws IOException {
         connect("https://geodata.nationaalgeoregister.nl", true);
     }
@@ -91,5 +91,5 @@
      */
     @Test
-    public void testTaiwanGovernment() throws IOException {
+    void testTaiwanGovernment() throws IOException {
         connect("https://grca.nat.gov.tw", true);
     }
Index: trunk/test/unit/org/openstreetmap/josm/io/ChangesetQueryUrlParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/ChangesetQueryUrlParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/ChangesetQueryUrlParserTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.time.OffsetDateTime;
@@ -12,5 +12,5 @@
 import java.util.Arrays;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlException;
 import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlParser;
@@ -20,5 +20,5 @@
  * Unit tests of {@link ChangesetQueryUrlParser} class
  */
-public class ChangesetQueryUrlParserTest {
+class ChangesetQueryUrlParserTest {
 
     /**
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testParseBasic() throws ChangesetQueryUrlException {
+    void testParseBasic() throws ChangesetQueryUrlException {
         ChangesetQueryUrlParser parser = new ChangesetQueryUrlParser();
 
@@ -56,5 +56,5 @@
      */
     @Test
-    public void testUid() throws ChangesetQueryUrlException {
+    void testUid() throws ChangesetQueryUrlException {
         ChangesetQueryUrlParser parser = new ChangesetQueryUrlParser();
         ChangesetQuery q;
@@ -74,5 +74,5 @@
      */
     @Test
-    public void testDisplayName() throws ChangesetQueryUrlException {
+    void testDisplayName() throws ChangesetQueryUrlException {
         ChangesetQueryUrlParser parser = new ChangesetQueryUrlParser();
         ChangesetQuery q;
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testOpen() throws ChangesetQueryUrlException {
+    void testOpen() throws ChangesetQueryUrlException {
         ChangesetQueryUrlParser parser = new ChangesetQueryUrlParser();
         ChangesetQuery q;
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testClosed() throws ChangesetQueryUrlException {
+    void testClosed() throws ChangesetQueryUrlException {
         ChangesetQueryUrlParser parser = new ChangesetQueryUrlParser();
         ChangesetQuery q;
@@ -134,5 +134,5 @@
      */
     @Test
-    public void testUidAndDisplayName() {
+    void testUidAndDisplayName() {
         shouldFail("uid=1&display_name=abcd");
     }
@@ -143,5 +143,5 @@
      */
     @Test
-    public void testTime() throws ChangesetQueryUrlException {
+    void testTime() throws ChangesetQueryUrlException {
         ChangesetQueryUrlParser parser = new ChangesetQueryUrlParser();
         ChangesetQuery q;
@@ -169,5 +169,5 @@
      */
     @Test
-    public void testBbox() throws ChangesetQueryUrlException {
+    void testBbox() throws ChangesetQueryUrlException {
         ChangesetQueryUrlParser parser = new ChangesetQueryUrlParser();
         ChangesetQuery q;
@@ -191,5 +191,5 @@
      */
     @Test
-    public void testChangesetIds() throws ChangesetQueryUrlException {
+    void testChangesetIds() throws ChangesetQueryUrlException {
         ChangesetQueryUrlParser parser = new ChangesetQueryUrlParser();
         ChangesetQuery q;
Index: trunk/test/unit/org/openstreetmap/josm/io/DiffResultProcessorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/DiffResultProcessorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/DiffResultProcessorTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.Arrays;
@@ -10,6 +10,6 @@
 import java.util.Set;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.Changeset;
@@ -31,10 +31,10 @@
  * Unit tests of {@link DiffResultProcessor}
  */
-public class DiffResultProcessorTest {
+class DiffResultProcessorTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -53,5 +53,5 @@
      */
     @Test
-    public void testConstructor() {
+    void testConstructor() {
         Node n = new Node(1);
         // these calls should not fail
@@ -66,5 +66,5 @@
      */
     @Test
-    public void testParse_NOK_Cases() {
+    void testParse_NOK_Cases() {
         shouldFail(null);
         shouldFail("");
@@ -77,5 +77,5 @@
      */
     @Test
-    public void testParse_OK_Cases() throws XmlParsingException {
+    void testParse_OK_Cases() throws XmlParsingException {
         DiffResultProcessor processor = new DiffResultProcessor(null);
         String doc =
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testPostProcess_Invocation_Variants() throws XmlParsingException {
+    void testPostProcess_Invocation_Variants() throws XmlParsingException {
         DiffResultProcessor processor = new DiffResultProcessor(null);
         String doc =
@@ -136,5 +136,5 @@
      */
     @Test
-    public void testPostProcess_OK() throws XmlParsingException {
+    void testPostProcess_OK() throws XmlParsingException {
 
         Node n = new Node();
@@ -171,5 +171,5 @@
      */
     @Test
-    public void testPostProcess_ForCreatedElement() throws XmlParsingException {
+    void testPostProcess_ForCreatedElement() throws XmlParsingException {
 
         Node n = new Node();
@@ -193,5 +193,5 @@
      */
     @Test
-    public void testPostProcess_ForModifiedElement() throws XmlParsingException {
+    void testPostProcess_ForModifiedElement() throws XmlParsingException {
 
         Node n = new Node(1);
@@ -218,5 +218,5 @@
      */
     @Test
-    public void testPostProcess_ForDeletedElement() throws XmlParsingException {
+    void testPostProcess_ForDeletedElement() throws XmlParsingException {
 
         Node n = new Node(1);
Index: trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -19,6 +19,6 @@
 import java.util.stream.IntStream;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -32,10 +32,10 @@
  * Unit tests of {@link GeoJSONReader}.
  */
-public class GeoJSONReaderTest {
+class GeoJSONReaderTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     public JOSMTestRules rules = new JOSMTestRules();
 
@@ -45,5 +45,5 @@
      */
     @Test
-    public void testReadGeoJson() throws Exception {
+    void testReadGeoJson() throws Exception {
         try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "geo.json"))) {
             final List<OsmPrimitive> primitives = new ArrayList<>(new GeoJSONReader()
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testReadLineByLineGeoJSON() throws Exception {
+    void testReadLineByLineGeoJSON() throws Exception {
         try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "geoLineByLine.json"))) {
             final List<OsmPrimitive> primitives = new ArrayList<>(new GeoJSONReader()
@@ -150,5 +150,5 @@
      */
     @Test
-    public void testReadGeoJsonNamedCrs() throws Exception {
+    void testReadGeoJsonNamedCrs() throws Exception {
         try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "geocrs.json"))) {
             final List<OsmPrimitive> primitives = new ArrayList<>(new GeoJSONReader()
@@ -165,5 +165,5 @@
      */
     @Test
-    public void testReadGeoJsonWithoutType() {
+    void testReadGeoJsonWithoutType() {
         assertThrows(IllegalDataException.class, () ->
                 new GeoJSONReader().doParseDataSet(new ByteArrayInputStream("{}".getBytes(StandardCharsets.UTF_8)), null));
@@ -193,5 +193,5 @@
      */
     @Test
-    public void testTicket19822() throws Exception {
+    void testTicket19822() throws Exception {
         try (InputStream in = TestUtils.getRegressionDataStream(19822, "data.geojson")) {
             final List<OsmPrimitive> primitives = new ArrayList<>(
@@ -207,5 +207,5 @@
      */
     @Test
-    public void testTicket19822Nested() throws Exception {
+    void testTicket19822Nested() throws Exception {
         try (InputStream in = TestUtils.getRegressionDataStream(19822, "problem3.geojson")) {
             final List<OsmPrimitive> primitives = new ArrayList<>(
Index: trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/GeoJSONWriterTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.InputStream;
@@ -10,6 +10,6 @@
 import java.util.Arrays;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
@@ -22,10 +22,10 @@
  * Unit tests of {@link GeoJSONWriter} class.
  */
-public class GeoJSONWriterTest {
+class GeoJSONWriterTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testPoint() {
+    void testPoint() {
         final Node node = new Node(new LatLon(12.3, 4.56));
         node.put("name", "foo");
@@ -75,5 +75,5 @@
      */
     @Test
-    public void testLineString() {
+    void testLineString() {
         final DataSet ds = new DataSet();
         final Node n1 = new Node(new LatLon(12.3, 4.56));
@@ -119,5 +119,5 @@
      */
     @Test
-    public void testMultipolygon() throws Exception {
+    void testMultipolygon() throws Exception {
         try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
@@ -132,5 +132,5 @@
      */
     @Test
-    public void testMultipolygonRobustness() throws Exception {
+    void testMultipolygonRobustness() throws Exception {
         try (InputStream in = Files.newInputStream(Paths.get("nodist/data/multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
Index: trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java	(revision 17275)
@@ -2,6 +2,7 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.io.ByteArrayInputStream;
@@ -14,6 +15,6 @@
 import java.util.Map;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
@@ -34,5 +35,5 @@
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -60,5 +61,5 @@
      */
     @Test
-    public void testMunich() throws Exception {
+    void testMunich() throws Exception {
         final GpxData result = parseGpxData("nodist/data/munich.gpx");
         assertEquals(2762, result.getTracks().size());
@@ -76,5 +77,5 @@
      */
     @Test
-    public void testLayerPrefs() throws Exception {
+    void testLayerPrefs() throws Exception {
         final GpxData data = parseGpxData(TestUtils.getTestDataRoot() + "tracks/tracks-layerprefs.gpx");
         Map<String, String> e = new HashMap<>();
@@ -93,7 +94,8 @@
      * @throws Exception always SAXException
      */
-    @Test(expected = SAXException.class)
-    public void testException() throws Exception {
-        new GpxReader(new ByteArrayInputStream("--foo--bar--".getBytes(StandardCharsets.UTF_8))).parse(true);
+    @Test
+    void testException() throws Exception {
+        assertThrows(SAXException.class,
+                () -> new GpxReader(new ByteArrayInputStream("--foo--bar--".getBytes(StandardCharsets.UTF_8))).parse(true));
     }
 
@@ -104,5 +106,5 @@
      */
     @Test
-    public void testTicket15634() throws IOException, SAXException {
+    void testTicket15634() throws IOException, SAXException {
         assertEquals(new Bounds(53.7229357, -7.9135019, 53.9301103, -7.59656),
                 GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(15634, "drumlish.gpx")).getMetaBounds());
Index: trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java	(revision 17275)
@@ -15,6 +15,6 @@
 import java.util.function.Consumer;
 
-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.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxConstants;
@@ -37,5 +37,5 @@
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testTicket16550() throws IOException {
+    void testTicket16550() throws IOException {
         // Checks that time stored as date is correctly written into XML timestamp
         testSingleWaypoint(
@@ -80,5 +80,5 @@
      */
     @Test
-    public void testTicket16725() throws IOException {
+    void testTicket16725() throws IOException {
         // Checks that sat, hdop, pdop, vdop are correctly exported
         testSingleWaypoint(
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testExtensions() throws IOException {
+    void testExtensions() throws IOException {
         GpxData data = new GpxData();
         // only namespace, no location printed
Index: trunk/test/unit/org/openstreetmap/josm/io/MultiFetchOverpassObjectReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/MultiFetchOverpassObjectReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/MultiFetchOverpassObjectReaderTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -20,10 +20,10 @@
  * Unit tests of {@link MultiFetchOverpassObjectReader}.
  */
-public class MultiFetchOverpassObjectReaderTest {
+class MultiFetchOverpassObjectReaderTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testBuildRequestNodesString() {
+    void testBuildRequestNodesString() {
         List<OsmPrimitive> objects = Arrays.asList(new Node(123), new Node(126), new Node(130));
         String requestString;
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testBuildRequestWaysString() {
+    void testBuildRequestWaysString() {
         List<OsmPrimitive> objects = Arrays.asList(new Way(123), new Way(126), new Way(130));
         String requestString;
@@ -86,5 +86,5 @@
      */
     @Test
-    public void testBuildRequestRelationsString() {
+    void testBuildRequestRelationsString() {
         List<OsmPrimitive> objects = Arrays.asList(new Relation(123), new Relation(126), new Relation(130));
         String requestString;
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testBuildComplexString() {
+    void testBuildComplexString() {
         List<OsmPrimitive> objects = Arrays.asList(new Relation(123), new Relation(126), new Relation(130), new Way(88), new Way(99),
                 new Node(1));
Index: trunk/test/unit/org/openstreetmap/josm/io/NameFinderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/NameFinderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/NameFinderTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.StringReader;
@@ -8,10 +8,10 @@
 import java.util.stream.Collectors;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link NameFinder} class.
  */
-public class NameFinderTest {
+class NameFinderTest {
 
     // CHECKSTYLE.OFF: LineLength
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testParseSearchResults() throws Exception {
+    void testParseSearchResults() throws Exception {
         try (StringReader reader = new StringReader(SAMPLE)) {
             assertEquals(Arrays.asList(
Index: trunk/test/unit/org/openstreetmap/josm/io/NetworkManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/NetworkManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/NetworkManagerTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.net.MalformedURLException;
@@ -10,6 +10,6 @@
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -19,10 +19,10 @@
  * Unit tests of {@link NetworkManager} class.
  */
-public class NetworkManagerTest {
+class NetworkManagerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().https().devAPI().main().projection();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testNetworkErrors() throws MalformedURLException {
+    void testNetworkErrors() throws MalformedURLException {
         NetworkManager.clearNetworkErrors();
         assertTrue(NetworkManager.getNetworkErrors().isEmpty());
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testOfflineResources() {
+    void testOfflineResources() {
         NetworkManager.setOnline(OnlineResource.ALL);
         assertFalse(NetworkManager.isOffline("http://www.example.com/"));
Index: trunk/test/unit/org/openstreetmap/josm/io/NoteReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/NoteReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/NoteReaderTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.IOException;
 import java.util.List;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.notes.Note;
@@ -20,5 +20,5 @@
  * Unit tests of {@link NoteReader} class.
  */
-public class NoteReaderTest {
+class NoteReaderTest {
 
     /**
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testNoteReader() throws SAXException, IOException {
+    void testNoteReader() throws SAXException, IOException {
         List<Note> list = new NoteReader(
             "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testTicket12393() throws Exception {
+    void testTicket12393() throws Exception {
         // CHECKSTYLE.OFF: LineLength
         new NoteReader(
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmApiExceptionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmApiExceptionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmApiExceptionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -14,10 +14,10 @@
  * Unit tests of {@link OsmApiException} class.
  */
-public class OsmApiExceptionTest {
+class OsmApiExceptionTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testTicket17328() {
+    void testTicket17328() {
         assertFalse(new OsmApiException(503, "foo", "bar").isHtml());
         assertTrue(new OsmApiException(503, null, "<h2>This website is under heavy load (queue full)</h2><p>Sorry...</p>").isHtml());
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmApiTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmApiTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmApiTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.ByteArrayInputStream;
 import java.nio.charset.StandardCharsets;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.Changeset;
@@ -17,10 +17,10 @@
  * Unit tests of {@link OsmApi} class.
  */
-public class OsmApiTest {
+class OsmApiTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testTicket12675() throws IllegalDataException {
+    void testTicket12675() throws IllegalDataException {
         OsmApi api = OsmApi.getOsmApi();
         Changeset cs = new Changeset();
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmChangeBuilderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmChangeBuilderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmChangeBuilderTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.util.Arrays;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.Changeset;
@@ -20,10 +20,10 @@
  * Unit tests of {@link OsmChangeBuilder}
  */
-public class OsmChangeBuilderTest {
+class OsmChangeBuilderTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testConstructor() {
+    void testConstructor() {
         Changeset cs = new Changeset(1);
         // should not fail
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testSequenceOfMethodCalls() {
+    void testSequenceOfMethodCalls() {
         Changeset cs = new Changeset(1);
         OsmChangeBuilder csBuilder = new OsmChangeBuilder(cs);
@@ -93,5 +93,5 @@
      */
     @Test
-    public void testDocumentWithNewNode() {
+    void testDocumentWithNewNode() {
         Changeset cs = new Changeset(1);
         OsmChangeBuilder builder = new OsmChangeBuilder(cs);
@@ -114,5 +114,5 @@
      */
     @Test
-    public void testDocumentWithModifiedNode() {
+    void testDocumentWithModifiedNode() {
         Changeset cs = new Changeset(1);
         OsmChangeBuilder builder = new OsmChangeBuilder(cs);
@@ -137,5 +137,5 @@
      */
     @Test
-    public void testDocumentWithDeletedNode() {
+    void testDocumentWithDeletedNode() {
         Changeset cs = new Changeset(1);
         OsmChangeBuilder builder = new OsmChangeBuilder(cs);
@@ -160,5 +160,5 @@
      */
     @Test
-    public void testMixed() {
+    void testMixed() {
         Changeset cs = new Changeset(1);
         OsmChangeBuilder builder = new OsmChangeBuilder(cs);
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmChangeReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmChangeReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmChangeReaderTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.ByteArrayInputStream;
@@ -10,6 +10,6 @@
 import java.util.Iterator;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.notes.Note;
@@ -25,10 +25,10 @@
  * Unit tests of {@link OsmChangeReader}.
  */
-public class OsmChangeReaderTest {
+class OsmChangeReaderTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -54,5 +54,5 @@
      */
     @Test
-    public void testNotes() throws Exception {
+    void testNotes() throws Exception {
         NoteData nd = parse(
                 "<create>\r\n" +
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayInputStream;
@@ -12,6 +12,6 @@
 import java.util.Arrays;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.ChangesetDataSet;
 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;
@@ -31,10 +31,10 @@
  * Unit tests of {@link OsmChangesetContentParser}.
  */
-public class OsmChangesetContentParserTest {
+class OsmChangesetContentParserTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -54,5 +54,5 @@
     @Test
     @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL")
-    public void test_Constructor() {
+    void test_Constructor() {
 
         // should be OK
@@ -73,5 +73,5 @@
      */
     @Test
-    public void test_parse_arguments() throws XmlParsingException {
+    void test_parse_arguments() throws XmlParsingException {
         OsmChangesetContentParser parser;
 
@@ -96,5 +96,5 @@
      */
     @Test
-    public void test_OK_OneCreatedNode() throws XmlParsingException {
+    void test_OK_OneCreatedNode() throws XmlParsingException {
         OsmChangesetContentParser parser;
 
@@ -126,5 +126,5 @@
      */
     @Test
-    public void test_OK_OneUpdatedNode() throws XmlParsingException {
+    void test_OK_OneUpdatedNode() throws XmlParsingException {
         OsmChangesetContentParser parser;
 
@@ -156,5 +156,5 @@
      */
     @Test
-    public void test_OK_OneDeletedNode() throws XmlParsingException {
+    void test_OK_OneDeletedNode() throws XmlParsingException {
         OsmChangesetContentParser parser;
 
@@ -186,5 +186,5 @@
      */
     @Test
-    public void test_OK_ComplexTestCase() throws XmlParsingException {
+    void test_OK_ComplexTestCase() throws XmlParsingException {
         OsmChangesetContentParser parser;
 
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetParserTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.ByteArrayInputStream;
@@ -9,6 +9,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
@@ -20,5 +20,5 @@
  * Unit tests of {@link OsmChangesetParser} class.
  */
-public class OsmChangesetParserTest {
+class OsmChangesetParserTest {
 
     private static final String BEGIN =
@@ -58,5 +58,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testParseWithoutDiscussion() throws IllegalDataException {
+    void testParseWithoutDiscussion() throws IllegalDataException {
         // http://api.openstreetmap.org/api/0.6/changeset/36749147
         Changeset cs = parse(BEGIN + END).iterator().next();
@@ -84,5 +84,5 @@
      */
     @Test
-    public void testParseWithDiscussion() throws IllegalDataException {
+    void testParseWithDiscussion() throws IllegalDataException {
         // http://api.openstreetmap.org/api/0.6/changeset/36749147?include_discussion=true
         Changeset cs = parse(BEGIN + DISCUSSION + END).iterator().next();
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.ByteArrayInputStream;
@@ -11,7 +11,7 @@
 import java.util.Iterator;
 
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+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.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -29,10 +29,10 @@
  * Unit tests of {@link OsmReader} class.
  */
-public class OsmJsonReaderTest {
+class OsmJsonReaderTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -41,5 +41,5 @@
      * Setup test
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         DateUtils.newIsoDateTimeFormat().setTimeZone(DateUtils.UTC);
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testHeader() throws Exception {
+    void testHeader() throws Exception {
         DataSet ds = parse("");
         assertEquals("0.6", ds.getVersion());
@@ -99,5 +99,5 @@
      */
     @Test
-    public void testNodeSpatialData() throws Exception {
+    void testNodeSpatialData() throws Exception {
         DataSet ds = parse("{\n" +
                 "  \"type\": \"node\",\n" +
@@ -116,5 +116,5 @@
      */
     @Test
-    public void testNodeMetaData() throws Exception {
+    void testNodeMetaData() throws Exception {
         DataSet ds = parse("{\n" +
                 "  \"type\": \"node\",\n" +
@@ -143,5 +143,5 @@
      */
     @Test
-    public void testNodeTags() throws Exception {
+    void testNodeTags() throws Exception {
         DataSet ds = parse("{\n" +
                 "  \"type\": \"node\",\n" +
@@ -167,5 +167,5 @@
      */
     @Test
-    public void testWay() throws Exception {
+    void testWay() throws Exception {
         DataSet ds = parse("{\n" +
                 "  \"type\": \"way\",\n" +
@@ -199,5 +199,5 @@
      */
     @Test
-    public void testRelation() throws Exception {
+    void testRelation() throws Exception {
         DataSet ds = parse("{\n" +
                 "  \"type\": \"relation\",\n" +
@@ -244,5 +244,5 @@
      */
     @Test
-    public void testEmptyRelation() throws Exception {
+    void testEmptyRelation() throws Exception {
         DataSet ds = parse("{\n" +
                 "  \"type\": \"relation\",\n" +
@@ -260,5 +260,5 @@
      */
     @Test
-    public void testRemark() throws Exception {
+    void testRemark() throws Exception {
         DataSet ds = parse("", "," +
                 "  \"remark\": \"runtime error: Query ran out of memory in \\\"query\\\" at line 5.\"\n");
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmReaderTest.java	(revision 17275)
@@ -5,9 +5,9 @@
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayInputStream;
@@ -18,6 +18,6 @@
 import java.util.Arrays;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -34,10 +34,10 @@
  * Unit tests of {@link OsmReader} class.
  */
-public class OsmReaderTest {
+class OsmReaderTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -66,5 +66,5 @@
      */
     @Test
-    public void testPostProcessors() throws Exception {
+    void testPostProcessors() throws Exception {
         PostProcessorStub registered = new PostProcessorStub();
         PostProcessorStub unregistered = new PostProcessorStub();
@@ -96,5 +96,5 @@
      */
     @Test
-    public void testUnknownRoot() throws Exception {
+    void testUnknownRoot() throws Exception {
         for (Options[] options : options()) {
             testUnknown("<nonosm/>", options);
@@ -107,5 +107,5 @@
      */
     @Test
-    public void testUnknownMeta() throws Exception {
+    void testUnknownMeta() throws Exception {
         for (Options[] options : options()) {
             testUnknown("<osm version='0.6'><meta osm_base='2017-03-29T19:04:03Z'/></osm>", options);
@@ -118,5 +118,5 @@
      */
     @Test
-    public void testUnknownNote() throws Exception {
+    void testUnknownNote() throws Exception {
         for (Options[] options : options()) {
             testUnknown("<osm version='0.6'><note>The data included in this document is from www.openstreetmap.org.</note></osm>", options);
@@ -129,5 +129,5 @@
      */
     @Test
-    public void testUnknownTag() throws Exception {
+    void testUnknownTag() throws Exception {
         for (Options[] options : options()) {
             testUnknown("<osm version='0.6'><foo>bar</foo></osm>", options);
@@ -170,5 +170,5 @@
      */
     @Test
-    public void testInvalidUid() throws Exception {
+    void testInvalidUid() throws Exception {
         testInvalidData("<osm version='0.6'><node id='1' uid='nan'/></osm>",
                 "Illegal value for attribute 'uid'. Got 'nan'. (at line 1, column 82). 82 bytes have been read");
@@ -180,5 +180,5 @@
      */
     @Test
-    public void testMissingId() throws Exception {
+    void testMissingId() throws Exception {
         testInvalidData("<osm version='0.6'><node/></osm>",
                 "Missing required attribute 'id'. (at line 1, column 65). 64 bytes have been read");
@@ -190,5 +190,5 @@
      */
     @Test
-    public void testMissingRef() throws Exception {
+    void testMissingRef() throws Exception {
         testInvalidData("<osm version='0.6'><way id='1' version='1'><nd/></way></osm>",
                 "Missing mandatory attribute 'ref' on <nd> of way 1. (at line 1, column 87). 88 bytes have been read");
@@ -202,5 +202,5 @@
      */
     @Test
-    public void testIllegalRef() throws Exception {
+    void testIllegalRef() throws Exception {
         testInvalidData("<osm version='0.6'><way id='1' version='1'><nd ref='0'/></way></osm>",
                 "Illegal value of attribute 'ref' of element <nd>. Got 0. (at line 1, column 95). 96 bytes have been read");
@@ -219,5 +219,5 @@
      */
     @Test
-    public void testMissingType() throws Exception {
+    void testMissingType() throws Exception {
         testInvalidData("<osm version='0.6'><relation id='1' version='1'><member ref='1'/></relation></osm>",
                 "Missing attribute 'type' on member 1 in relation 1. (at line 1, column 104). 109 bytes have been read");
@@ -229,5 +229,5 @@
      */
     @Test
-    public void testIllegalType() throws Exception {
+    void testIllegalType() throws Exception {
         testInvalidData("<osm version='0.6'><relation id='1' version='1'><member type='foo' ref='1'/></relation></osm>",
                 "Illegal value for attribute 'type' on member 1 in relation 1. Got foo. (at line 1, column 115). 120 bytes have been read");
@@ -239,5 +239,5 @@
      */
     @Test
-    public void testMissingKeyValue() throws Exception {
+    void testMissingKeyValue() throws Exception {
         testInvalidData("<osm version='0.6'><node id='1' version='1'><tag/></node></osm>",
                 "Missing key or value attribute in tag. (at line 1, column 89). 89 bytes have been read");
@@ -253,5 +253,5 @@
      */
     @Test
-    public void testMissingVersion() throws Exception {
+    void testMissingVersion() throws Exception {
         testInvalidData("<osm/>",
                 "Missing mandatory attribute 'version'. (at line 1, column 45). 44 bytes have been read");
@@ -265,5 +265,5 @@
      */
     @Test
-    public void testUnsupportedVersion() throws Exception {
+    void testUnsupportedVersion() throws Exception {
         testInvalidData("<osm version='0.1'/>",
                 "Unsupported version: 0.1 (at line 1, column 59). 58 bytes have been read");
@@ -275,5 +275,5 @@
      */
     @Test
-    public void testIllegalVersion() throws Exception {
+    void testIllegalVersion() throws Exception {
         testInvalidData("<osm version='0.6'><node id='1' version='nan'/></osm>",
                 "Illegal value for attribute 'version' on OSM primitive with ID 1. Got nan. (at line 1, column 86). 86 bytes have been read");
@@ -285,5 +285,5 @@
      */
     @Test
-    public void testIllegalChangeset() throws Exception {
+    void testIllegalChangeset() throws Exception {
         testInvalidData("<osm version='0.6'><node id='1' version='1' changeset='nan'/></osm>",
                 "Illegal value for attribute 'changeset'. Got nan. (at line 1, column 100). 100 bytes have been read");
@@ -297,5 +297,5 @@
      */
     @Test
-    public void testGdprChangeset() throws Exception {
+    void testGdprChangeset() throws Exception {
         String gdprChangeset = "<osm version='0.6'><node id='1' version='1' changeset='0'/></osm>";
         for (Options[] options : options()) {
@@ -309,5 +309,5 @@
      */
     @Test
-    public void testInvalidBounds() throws Exception {
+    void testInvalidBounds() throws Exception {
         testInvalidData("<osm version='0.6'><bounds/></osm>",
                 "Missing mandatory attributes on element 'bounds'. " +
@@ -329,5 +329,5 @@
      */
     @Test
-    public void testTicket14199() throws Exception {
+    void testTicket14199() throws Exception {
         try (InputStream in = TestUtils.getRegressionDataStream(14199, "emptytag.osm")) {
             Way w = OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE).getWays().iterator().next();
@@ -343,5 +343,5 @@
      */
     @Test
-    public void testTicket14754() throws Exception {
+    void testTicket14754() throws Exception {
         try (InputStream in = TestUtils.getRegressionDataStream(14754, "malformed_for_14754.osm")) {
             OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE);
@@ -361,5 +361,5 @@
      */
     @Test
-    public void testTicket14788() throws Exception {
+    void testTicket14788() throws Exception {
         try (InputStream in = TestUtils.getRegressionDataStream(14788, "remove_sign_test_4.osm")) {
             OsmReader.parseDataSet(in, NullProgressMonitor.INSTANCE);
@@ -379,5 +379,5 @@
      */
     @Test
-    public void testRemark() throws Exception {
+    void testRemark() throws Exception {
         String query = "<osm version=\"0.6\" generator=\"Overpass API 0.7.55.4 3079d8ea\">\r\n" +
                 "<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>\r\n" +
@@ -396,5 +396,5 @@
      */
     @Test
-    public void testUnknownAttributeTags() throws Exception {
+    void testUnknownAttributeTags() throws Exception {
         String testData = "<osm version=\"0.6\" generator=\"fake generator\">"
                 + "<node id='1' version='1' visible='true' changeset='82' randomkey='randomvalue'></node>" + "</osm>";
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.ByteArrayOutputStream;
@@ -16,5 +16,5 @@
 import java.util.List;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Changeset;
@@ -28,5 +28,5 @@
  * Unit tests of {@link OsmWriter} class.
  */
-public class OsmWriterTest {
+class OsmWriterTest {
 
     /**
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testByIdComparator() {
+    void testByIdComparator() {
 
         final List<NodeData> ids = new ArrayList<>();
@@ -56,5 +56,5 @@
      */
     @Test
-    public void testHeader() throws IOException {
+    void testHeader() throws IOException {
         doTestHeader(null, null,
                 "<osm version='0.6' generator='JOSM'>");
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testWriteLock() throws IOException {
+    void testWriteLock() throws IOException {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (PrintWriter out = new PrintWriter(new OutputStreamWriter(baos, StandardCharsets.UTF_8));
@@ -101,5 +101,5 @@
      */
     @Test
-    public void testChangeset() throws IOException {
+    void testChangeset() throws IOException {
         Changeset cs = new Changeset();
         cs.setUser(User.getAnonymous());
Index: trunk/test/unit/org/openstreetmap/josm/io/ParseWithChangesetReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/ParseWithChangesetReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/ParseWithChangesetReaderTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayInputStream;
@@ -11,6 +11,6 @@
 import java.nio.charset.StandardCharsets;
 
-import org.junit.Rule;
-import org.junit.Test;
+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.Node;
@@ -25,10 +25,10 @@
  * Additional unit tests for {@link OsmReader}.
  */
-public class ParseWithChangesetReaderTest {
+class ParseWithChangesetReaderTest {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -54,5 +54,5 @@
      */
     @Test
-    public void test_1() throws Exception {
+    void test_1() throws Exception {
         String doc =
             "<osm version=\"0.6\">\n" +
@@ -73,5 +73,5 @@
      */
     @Test
-    public void test_11() throws Exception {
+    void test_11() throws Exception {
         String doc =
         "<osm version=\"0.6\">\n" +
@@ -92,5 +92,5 @@
      */
     @Test
-    public void test_12() throws Exception {
+    void test_12() throws Exception {
         String doc =
         "<osm version=\"0.6\">\n" +
@@ -111,5 +111,5 @@
      */
     @Test
-    public void test_13() throws Exception {
+    void test_13() throws Exception {
         String doc =
         "<osm version=\"0.6\">\n" +
@@ -131,5 +131,5 @@
      */
     @Test
-    public void test_14() throws Exception {
+    void test_14() throws Exception {
         String doc =
         "<osm version=\"0.6\">\n" +
@@ -152,5 +152,5 @@
      */
     @Test
-    public void test_2() throws Exception {
+    void test_2() throws Exception {
         String doc =
         "<osm version=\"0.6\">\n" +
@@ -171,5 +171,5 @@
      */
     @Test
-    public void test_3() throws Exception {
+    void test_3() throws Exception {
         String doc =
         "<osm version=\"0.6\">\n" +
@@ -190,5 +190,5 @@
      */
     @Test
-    public void test_4() throws IOException {
+    void test_4() throws IOException {
         String doc =
         "<osm version=\"0.6\">\n" +
@@ -205,5 +205,5 @@
      */
     @Test
-    public void test_5() throws IOException {
+    void test_5() throws IOException {
         String doc =
         "<osm version=\"0.6\">\n" +
@@ -220,5 +220,5 @@
      */
     @Test
-    public void test_6() throws IOException {
+    void test_6() throws IOException {
         String doc =
             "<osm version=\"0.6\">\n" +
Index: trunk/test/unit/org/openstreetmap/josm/io/UrlPatternsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/UrlPatternsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/UrlPatternsTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -8,5 +8,5 @@
 import java.util.regex.Pattern;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 
@@ -14,5 +14,5 @@
  * Unit tests of {@link UrlPatterns}.
  */
-public class UrlPatternsTest {
+class UrlPatternsTest {
 
     private static final List<Class<? extends Enum<?>>> patterns = Arrays.asList(
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testUrlPatternEnums() {
+    void testUrlPatternEnums() {
         patterns.forEach(TestUtils::superficialEnumCodeCoverage);
     }
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testUrlPatterns() {
+    void testUrlPatterns() {
         assertTrue(patterns.stream().flatMap(c -> Arrays.stream(c.getEnumConstants())).map(t -> ((UrlPattern) t).pattern())
                 .map(Pattern::compile).count() > 0);
Index: trunk/test/unit/org/openstreetmap/josm/io/audio/AudioPlayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/audio/AudioPlayerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/audio/AudioPlayerTest.java	(revision 17275)
@@ -2,14 +2,16 @@
 package org.openstreetmap.josm.io.audio;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTimeout;
 
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.time.Duration;
 
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
@@ -19,6 +21,6 @@
  * Unit tests of {@link AudioPlayer} class.
  */
-@Ignore("unresolved sporadic deadlock - see #13809")
-public class AudioPlayerTest {
+@Disabled("unresolved sporadic deadlock - see #13809")
+class AudioPlayerTest {
 
     // We play wav files of about 4 seconds + pause, so define timeout at 16 seconds
@@ -28,5 +30,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -38,28 +40,30 @@
      * @throws MalformedURLException wrong URL
      */
-    @Test(timeout = 4*MAX_DURATION)
-    public void testPlay() throws MalformedURLException, Exception {
-        File wav1 = new File(TestUtils.getRegressionDataFile(6851, "20111003_121226.wav"));
-        File wav2 = new File(TestUtils.getRegressionDataFile(6851, "20111003_121557.wav"));
+    @Test
+    void testPlay() throws MalformedURLException, Exception {
+        assertTimeout(Duration.ofMillis(4*MAX_DURATION), () -> {
+            File wav1 = new File(TestUtils.getRegressionDataFile(6851, "20111003_121226.wav"));
+            File wav2 = new File(TestUtils.getRegressionDataFile(6851, "20111003_121557.wav"));
 
-        for (File w : new File[] {wav1, wav2}) {
-            System.out.println("Playing " + w.toPath());
-            URL url = w.toURI().toURL();
-            final Stopwatch stopwatch = Stopwatch.createStarted();
-            AudioPlayer.play(url);
-            assertTrue(AudioPlayer.playing());
-            assertFalse(AudioPlayer.paused());
-            AudioPlayer.pause();
-            assertFalse(AudioPlayer.playing());
-            assertTrue(AudioPlayer.paused());
-            AudioPlayer.play(url, AudioPlayer.position());
-            while (AudioPlayer.playing() && stopwatch.elapsed() < MAX_DURATION) {
-                Thread.sleep(500);
+            for (File w : new File[] {wav1, wav2}) {
+                System.out.println("Playing " + w.toPath());
+                URL url = w.toURI().toURL();
+                final Stopwatch stopwatch = Stopwatch.createStarted();
+                AudioPlayer.play(url);
+                assertTrue(AudioPlayer.playing());
+                assertFalse(AudioPlayer.paused());
+                AudioPlayer.pause();
+                assertFalse(AudioPlayer.playing());
+                assertTrue(AudioPlayer.paused());
+                AudioPlayer.play(url, AudioPlayer.position());
+                while (AudioPlayer.playing() && stopwatch.elapsed() < MAX_DURATION) {
+                    Thread.sleep(500);
+                }
+                System.out.println("Play finished after " + stopwatch);
+                assertTrue(stopwatch.elapsed() < MAX_DURATION);
+                AudioPlayer.reset();
+                Thread.sleep(1000); // precaution, see #13809
             }
-            System.out.println("Play finished after " + stopwatch);
-            assertTrue(stopwatch.elapsed() < MAX_DURATION);
-            AudioPlayer.reset();
-            Thread.sleep(1000); // precaution, see #13809
-        }
+        });
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/io/audio/AudioUtilTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/audio/AudioUtilTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/audio/AudioUtilTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.io.audio;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.File;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.TestUtils;
@@ -14,5 +14,5 @@
  * Unit tests of {@link AudioUtil} class.
  */
-public class AudioUtilTest {
+class AudioUtilTest {
 
     private static final double EPSILON = 1e-11;
@@ -21,5 +21,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testGetCalibratedDuration() {
+    void testGetCalibratedDuration() {
         assertEquals(0.0, AudioUtil.getCalibratedDuration(new File("invalid_file")), EPSILON);
         File wav1 = new File(TestUtils.getRegressionDataFile(6851, "20111003_121226.wav"));
Index: trunk/test/unit/org/openstreetmap/josm/io/auth/CredentialsAgentExceptionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/auth/CredentialsAgentExceptionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/auth/CredentialsAgentExceptionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.io.auth;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link CredentialsAgentException} class.
  */
-public class CredentialsAgentExceptionTest {
+class CredentialsAgentExceptionTest {
 
     /**
      * Setup test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testCredentialsAgentException() {
+    void testCredentialsAgentException() {
         String msg = "test1";
         Exception cause = new Exception("test2");
Index: trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.io.nmea;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.ByteArrayInputStream;
@@ -17,7 +17,7 @@
 import java.util.TimeZone;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -37,9 +37,9 @@
  * Unit tests of {@link NmeaReader} class.
  */
-public class NmeaReaderTest {
+class NmeaReaderTest {
     /**
      * Set the timezone and timeout.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -50,5 +50,5 @@
      * Forces the timezone.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         iso8601.setTimeZone(DateUtils.UTC);
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testReader() throws Exception {
+    void testReader() throws Exception {
         TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin"));
         final NmeaReader in = new NmeaReader(Files.newInputStream(Paths.get("nodist/data/btnmeatrack_2016-01-25.nmea")));
@@ -116,5 +116,5 @@
      */
     @Test
-    public void testIsSentence() {
+    void testIsSentence() {
         assertTrue(NmeaReader.isSentence("$GPVTG", Sentence.VTG));
         assertTrue(NmeaReader.isSentence("$GAVTG", Sentence.VTG));
@@ -130,5 +130,5 @@
      */
     @Test
-    public void testTicket1433() throws Exception {
+    void testTicket1433() throws Exception {
         compareWithReference(1433, "2008-08-14-16-04-58", 1241);
     }
@@ -139,5 +139,5 @@
      */
     @Test
-    public void testTicket1853() throws Exception {
+    void testTicket1853() throws Exception {
         compareWithReference(1853, "PosData-20081216-115434", 1285);
     }
@@ -148,5 +148,5 @@
      */
     @Test
-    public void testTicket2147() throws Exception {
+    void testTicket2147() throws Exception {
         compareWithReference(2147, "WG20080203171807.log", 487);
     }
@@ -157,5 +157,5 @@
      */
     @Test
-    public void testTicket14924() throws Exception {
+    void testTicket14924() throws Exception {
         compareWithReference(14924, "input", 0);
     }
@@ -184,5 +184,5 @@
      */
     @Test
-    public void testTicket16496() throws Exception {
+    void testTicket16496() throws Exception {
         assertEquals("2018-05-30T16:28:59.400Z", iso8601.format(
                 readDate("$GNRMC,162859.400,A,4543.03388,N,00058.19870,W,45.252,209.07,300518,,,D,V*13")));
@@ -198,5 +198,5 @@
      */
     @Test
-    public void testTicket16554() throws Exception {
+    void testTicket16554() throws Exception {
         assertEquals(63.2420959, readSpeed(
                   "$GNRMC,141448.80,A,4659.05514,N,00130.44695,W,34.148,289.80,300718,,,D,V*26"), 1e-7);
Index: trunk/test/unit/org/openstreetmap/josm/io/protocols/data/HandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/protocols/data/HandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/protocols/data/HandlerTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.io.protocols.data;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.IOException;
@@ -8,7 +8,7 @@
 import java.net.URLConnection;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
 
@@ -16,10 +16,10 @@
  * Unit tests of {@link Handler} class.
  */
-public class HandlerTest {
+class HandlerTest {
 
     /**
      * Use the test rules to remove any layers and reset state.
      */
-    @Rule
+    @RegisterExtension
     public final JOSMTestRules rules = new JOSMTestRules();
 
@@ -27,5 +27,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         Handler.install();
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testBase64Image() throws IOException {
+    void testBase64Image() throws IOException {
         // Red dot image, taken from https://en.wikipedia.org/wiki/Data_URI_scheme#HTML
         URLConnection connection = new Handler().openConnection(new URL("data:image/png;base64," +
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/AddTagsDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/AddTagsDialogTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/AddTagsDialogTest.java	(revision 17275)
@@ -2,10 +2,10 @@
 package org.openstreetmap.josm.io.remotecontrol;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -15,9 +15,9 @@
  * Unit tests for class {@link AddTagsDialog}.
  */
-public class AddTagsDialogTest {
+class AddTagsDialogTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testParseUrlTagsToKeyValues() {
+    void testParseUrlTagsToKeyValues() {
         Map<String, String> strings = AddTagsDialog.parseUrlTagsToKeyValues("wikipedia:de=Residenzschloss Dresden|name:en=Dresden Castle");
         assertEquals(2, strings.size());
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.io.remotecontrol;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.BufferedReader;
@@ -15,8 +15,8 @@
 import java.util.stream.Collectors;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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.spi.preferences.Config;
@@ -32,5 +32,5 @@
  * Unit tests for Remote Control
  */
-public class RemoteControlTest {
+class RemoteControlTest {
 
     private String httpBase;
@@ -46,5 +46,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().https().assertionsInEDT();
@@ -54,5 +54,5 @@
      * @throws GeneralSecurityException if a security error occurs
      */
-    @Before
+    @BeforeEach
     public void setUp() throws GeneralSecurityException {
         if (PlatformManager.isPlatformWindows() && "True".equals(System.getenv("APPVEYOR"))) {
@@ -69,5 +69,5 @@
      * Stops Remote control after testing requests.
      */
-    @After
+    @AfterEach
     public void tearDown() {
         RemoteControl.stop();
@@ -79,5 +79,5 @@
      */
     @Test
-    public void testHttpListOfCommands() throws Exception {
+    void testHttpListOfCommands() throws Exception {
         testListOfCommands(httpBase);
     }
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RequestProcessorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RequestProcessorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RequestProcessorTest.java	(revision 17275)
@@ -13,10 +13,10 @@
  * @author Taylor Smock
  */
-public class RequestProcessorTest {
+class RequestProcessorTest {
     /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/19436">#19436</a>
      */
     @Test
-    public void testFeaturesDoesNotThrowNPE() {
+    void testFeaturesDoesNotThrowNPE() {
         assertTrue(RequestProcessor.getHandlersInfo(Arrays.asList("add_node", "/add_node", "", null))
                 .noneMatch(Objects::isNull));
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java	(revision 17275)
@@ -6,6 +6,6 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -19,9 +19,9 @@
  * Unit tests of {@link AddNodeHandler} class.
  */
-public class AddNodeHandlerTest {
+class AddNodeHandlerTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main().assertionsInEDT().projection();
@@ -38,5 +38,5 @@
      */
     @Test
-    public void testBadRequestNoLayer() {
+    void testBadRequestNoLayer() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost?lat=0&lon=0").handle());
         assertEquals("There is no layer opened to add node", e.getMessage());
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testBadRequestNoParam() {
+    void testBadRequestNoParam() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         MainApplication.getLayerManager().addLayer(layer);
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testBadRequestInvalidUrl() {
+    void testBadRequestInvalidUrl() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("invalid_url").handle());
         assertEquals("The following keys are mandatory, but have not been provided: lat, lon", e.getMessage());
@@ -67,5 +67,5 @@
      */
     @Test
-    public void testBadRequestIncompleteUrl() {
+    void testBadRequestIncompleteUrl() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost").handle());
         assertEquals("The following keys are mandatory, but have not been provided: lat, lon", e.getMessage());
@@ -76,5 +76,5 @@
      */
     @Test
-    public void testNominalRequest() {
+    void testNominalRequest() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         MainApplication.getLayerManager().addLayer(layer);
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java	(revision 17275)
@@ -6,6 +6,6 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -19,9 +19,9 @@
  * Unit tests of {@link AddWayHandler} class.
  */
-public class AddWayHandlerTest {
+class AddWayHandlerTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -38,5 +38,5 @@
      */
     @Test
-    public void testBadRequestNoLayer() {
+    void testBadRequestNoLayer() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost?way=0,0;1,1").handle());
         assertEquals("There is no layer opened to add way", e.getMessage());
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testBadRequestNoParam() {
+    void testBadRequestNoParam() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         try {
@@ -62,5 +62,5 @@
      */
     @Test
-    public void testBadRequestInvalidUrl() {
+    void testBadRequestInvalidUrl() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("invalid_url").handle());
         assertEquals("The following keys are mandatory, but have not been provided: way", e.getMessage());
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testBadRequestIncompleteUrl() {
+    void testBadRequestIncompleteUrl() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost").handle());
         assertEquals("The following keys are mandatory, but have not been provided: way", e.getMessage());
@@ -80,5 +80,5 @@
      */
     @Test
-    public void testNominalRequest() {
+    void testNominalRequest() {
         OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null);
         try {
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java	(revision 17275)
@@ -4,5 +4,5 @@
 import static org.hamcrest.CoreMatchers.hasItem;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -11,6 +11,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
@@ -22,9 +22,9 @@
  * Unit tests of {@link ImageryHandler} class.
  */
-public class ImageryHandlerTest {
+class ImageryHandlerTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -41,5 +41,5 @@
      */
     @Test
-    public void testBadRequestNoParam() {
+    void testBadRequestNoParam() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler(null).handle());
         assertEquals("Parameter must not be null", e.getMessage());
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testBadRequestInvalidUrl() {
+    void testBadRequestInvalidUrl() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("invalid_url").handle());
         assertEquals("The following keys are mandatory, but have not been provided: url", e.getMessage());
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testBadRequestIncompleteUrl() {
+    void testBadRequestIncompleteUrl() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost").handle());
         assertEquals("The following keys are mandatory, but have not been provided: url", e.getMessage());
@@ -69,5 +69,5 @@
      */
     @Test
-    public void testNominalRequest() {
+    void testNominalRequest() {
         assertDoesNotThrow(() -> newHandler("https://localhost?url=foo").handle());
     }
@@ -78,5 +78,5 @@
      */
     @Test
-    public void testOptionalParams() throws Exception {
+    void testOptionalParams() throws Exception {
         List<String> optionalParams = Arrays.asList(newHandler("").getOptionalParams());
         assertThat(optionalParams, hasItem("type"));
@@ -91,5 +91,5 @@
      */
     @Test
-    public void testBuildImageryInfo() throws Exception {
+    void testBuildImageryInfo() throws Exception {
         String url = "https://localhost/imagery?title=osm"
                 + "&type=tms&min_zoom=3&max_zoom=23&category=osmbasedmap&country_code=XA"
@@ -110,5 +110,5 @@
      */
     @Test
-    public void testTicket19483() throws Exception {
+    void testTicket19483() throws Exception {
         String url = "https://localhost/imagery?url=" +
                 "tms[3-7]%3Ahttps%3A%2F%2Fservices.digitalglobe.com%2Fearthservice%2Ftmsaccess%2F" +
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.io.remotecontrol.handler;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -8,6 +8,6 @@
 import java.io.File;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -22,9 +22,9 @@
  * Unit tests of {@link ImportHandler} class.
  */
-public class ImportHandlerTest {
+class ImportHandlerTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().main();
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testTicket7434() throws Exception {
+    void testTicket7434() throws Exception {
         ImportHandler req = newHandler("http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711&mode=recursive");
         assertEquals("http://localhost:8888/relations?relations=19711&mode=recursive", req.args.get("url"));
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testBadRequestNoParam() throws Exception {
+    void testBadRequestNoParam() throws Exception {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler(null).handle());
         assertEquals("MalformedURLException: null", e.getMessage());
@@ -62,5 +62,5 @@
      */
     @Test
-    public void testBadRequestInvalidUrl() throws Exception {
+    void testBadRequestInvalidUrl() throws Exception {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost?url=invalid_url").handle());
         assertEquals("MalformedURLException: no protocol: invalid_url", e.getMessage());
@@ -72,5 +72,5 @@
      */
     @Test
-    public void testBadRequestIncompleteUrl() throws Exception {
+    void testBadRequestIncompleteUrl() throws Exception {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost").handle());
         assertEquals("The following keys are mandatory, but have not been provided: url", e.getMessage());
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testNominalRequest() throws Exception {
+    void testNominalRequest() throws Exception {
         String url = new File(TestUtils.getRegressionDataFile(11957, "data.osm")).toURI().toURL().toExternalForm();
         try {
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandlerTest.java	(revision 17275)
@@ -6,6 +6,6 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,9 +16,9 @@
  * Unit tests of {@link LoadAndZoomHandler} class.
  */
-public class LoadAndZoomHandlerTest {
+class LoadAndZoomHandlerTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testBadRequestNoParam() throws Exception {
+    void testBadRequestNoParam() throws Exception {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler(null).handle());
         assertEquals("NumberFormatException (empty String)", e.getMessage());
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testBadRequestInvalidUrl() throws Exception {
+    void testBadRequestInvalidUrl() throws Exception {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("invalid_url").handle());
         assertEquals("The following keys are mandatory, but have not been provided: bottom, top, left, right", e.getMessage());
@@ -56,5 +56,5 @@
      */
     @Test
-    public void testBadRequestIncompleteUrl() throws Exception {
+    void testBadRequestIncompleteUrl() throws Exception {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost").handle());
         assertEquals("The following keys are mandatory, but have not been provided: bottom, top, left, right", e.getMessage());
@@ -66,5 +66,5 @@
      */
     @Test
-    public void testNominalRequest() throws Exception {
+    void testNominalRequest() throws Exception {
         assertDoesNotThrow(() -> newHandler("https://localhost?bottom=0&top=0&left=1&right=1").handle());
     }
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandlerTest.java	(revision 17275)
@@ -6,6 +6,6 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,9 +16,9 @@
  * Unit tests of {@link LoadObjectHandler} class.
  */
-public class LoadObjectHandlerTest {
+class LoadObjectHandlerTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testBadRequestNoParam() {
+    void testBadRequestNoParam() {
         assertDoesNotThrow(() -> newHandler(null).handle());
     }
@@ -43,5 +43,5 @@
      */
     @Test
-    public void testBadRequestInvalidUrl() {
+    void testBadRequestInvalidUrl() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("invalid_url").handle());
         assertEquals("The following keys are mandatory, but have not been provided: objects", e.getMessage());
@@ -52,5 +52,5 @@
      */
     @Test
-    public void testBadRequestIncompleteUrl() {
+    void testBadRequestIncompleteUrl() {
         Exception e = assertThrows(RequestHandlerBadRequestException.class, () -> newHandler("https://localhost").handle());
         assertEquals("The following keys are mandatory, but have not been provided: objects", e.getMessage());
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testNominalRequest() {
+    void testNominalRequest() {
         assertDoesNotThrow(() -> newHandler("https://localhost?objects=foo,bar").handle());
     }
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java	(revision 17275)
@@ -2,5 +2,6 @@
 package org.openstreetmap.josm.io.remotecontrol.handler;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Collections;
@@ -8,6 +9,6 @@
 import java.util.Map;
 
-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.io.remotecontrol.PermissionPrefWithDefault;
 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
@@ -19,10 +20,10 @@
  * Unit tests of {@link RequestHandler} class.
  */
-public class RequestHandlerTest {
+class RequestHandlerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -62,5 +63,5 @@
      */
     @Test
-    public void testRequestParameter1() throws RequestHandlerBadRequestException {
+    void testRequestParameter1() throws RequestHandlerBadRequestException {
         final Map<String, String> expected = new HashMap<>();
         expected.put("query", "a");
@@ -74,5 +75,5 @@
      */
     @Test
-    public void testRequestParameter2() throws RequestHandlerBadRequestException {
+    void testRequestParameter2() throws RequestHandlerBadRequestException {
         assertEquals(Collections.singletonMap("query", "a&b==c"),
                 getRequestParameter("http://example.com/?query=a%26b==c"));
@@ -84,5 +85,5 @@
      */
     @Test
-    public void testRequestParameter3() throws RequestHandlerBadRequestException {
+    void testRequestParameter3() throws RequestHandlerBadRequestException {
         assertEquals(Collections.singleton("blue+light blue"),
                 getRequestParameter("http://example.com/blue+light%20blue?blue%2Blight+blue").keySet());
@@ -96,5 +97,5 @@
      */
     @Test
-    public void testRequestParameter4() throws RequestHandlerBadRequestException {
+    void testRequestParameter4() throws RequestHandlerBadRequestException {
         assertEquals(Collections.singletonMap("/?:@-._~!$'()* ,;", "/?:@-._~!$'()* ,;=="), getRequestParameter(
             "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$'()*+,;=/?:@-._~!$'()*+,;==#/?:@-._~!$&'()*+,;="
@@ -107,5 +108,5 @@
      */
     @Test
-    public void testRequestParameter5() throws RequestHandlerBadRequestException {
+    void testRequestParameter5() throws RequestHandlerBadRequestException {
         final Map<String, String> expected = new HashMap<>();
         expected.put("space", " ");
@@ -119,5 +120,5 @@
      */
     @Test
-    public void testRequestParameter6() throws RequestHandlerBadRequestException {
+    void testRequestParameter6() throws RequestHandlerBadRequestException {
         final Map<String, String> expected = new HashMap<>();
         expected.put("addtags", "wikipedia:de=Weiße_Gasse|maxspeed=5");
@@ -135,12 +136,12 @@
     /**
      * Test request parameter - invalid case
-     * @throws RequestHandlerBadRequestException always
      */
-    @Test(expected = RequestHandlerBadRequestException.class)
-    public void testRequestParameterInvalid() throws RequestHandlerBadRequestException {
-        getRequestParameter("http://localhost:8111/load_and_zoom"+
+    @Test
+    void testRequestParameterInvalid() {
+        assertThrows(RequestHandlerBadRequestException.class,
+                () -> getRequestParameter("http://localhost:8111/load_and_zoom"+
                 "?addtags=wikipedia:de=Wei%C3%9Fe_Gasse|maxspeed=5"+
                 "&select=way23071688,way23076176,way23076177,"+
-                "&left=13.739727546842&right=13.740890970188&top=51.049987191025&bottom=51.048466954325");
+                "&left=13.739727546842&right=13.740890970188&top=51.049987191025&bottom=51.048466954325"));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.io.rtklib;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.IOException;
@@ -12,7 +12,7 @@
 import java.util.TimeZone;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -27,9 +27,9 @@
  * Unit tests of {@link RtkLibPosReader} class.
  */
-public class RtkLibPosReaderTest {
+class RtkLibPosReaderTest {
     /**
      * Set the timezone and timeout.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -40,5 +40,5 @@
      * Forces the timezone.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         iso8601.setTimeZone(DateUtils.UTC);
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testReader() throws Exception {
+    void testReader() throws Exception {
         RtkLibPosReader in = read("nodist/data/rtklib_example.pos");
         assertEquals(137, in.getNumberOfCoordinates());
@@ -83,5 +83,5 @@
      */
     @Test
-    public void testReader2() throws Exception {
+    void testReader2() throws Exception {
         RtkLibPosReader in = read("nodist/data/rtklib_example2.pos");
         assertEquals(6, in.getNumberOfCoordinates());
Index: trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.io.session;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.ByteArrayInputStream;
@@ -13,6 +13,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -33,10 +33,10 @@
  * Unit tests for Session reading.
  */
-public class SessionReaderTest {
+class SessionReaderTest {
 
     /**
      * Setup tests.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection();
@@ -60,5 +60,5 @@
      */
     @Test
-    public void testReadEmpty() throws IOException, IllegalDataException {
+    void testReadEmpty() throws IOException, IllegalDataException {
         assertTrue(testRead("empty.jos").isEmpty());
         assertTrue(testRead("empty.joz").isEmpty());
@@ -71,5 +71,5 @@
      */
     @Test
-    public void testReadOsm() throws IOException, IllegalDataException {
+    void testReadOsm() throws IOException, IllegalDataException {
         for (String file : new String[]{"osm.jos", "osm.joz"}) {
             List<Layer> layers = testRead(file);
@@ -87,5 +87,5 @@
      */
     @Test
-    public void testReadGpx() throws IOException, IllegalDataException {
+    void testReadGpx() throws IOException, IllegalDataException {
         for (String file : new String[]{"gpx.jos", "gpx.joz", "nmea.jos"}) {
             List<Layer> layers = testRead(file);
@@ -103,5 +103,5 @@
      */
     @Test
-    public void testReadGpxAndMarker() throws IOException, IllegalDataException {
+    void testReadGpxAndMarker() throws IOException, IllegalDataException {
         List<Layer> layers = testRead("gpx_markers.joz");
         assertEquals(layers.size(), 2);
@@ -127,5 +127,5 @@
      */
     @Test
-    public void testReadImage() throws IOException, IllegalDataException {
+    void testReadImage() throws IOException, IllegalDataException {
         final List<Layer> layers = testRead("bing.jos");
         assertEquals(layers.size(), 1);
@@ -144,5 +144,5 @@
      */
     @Test
-    public void testReadNotes() throws IOException, IllegalDataException {
+    void testReadNotes() throws IOException, IllegalDataException {
         if (MainApplication.isDisplayingMapView()) {
             for (NoteLayer nl : MainApplication.getLayerManager().getLayersOfType(NoteLayer.class)) {
@@ -163,5 +163,5 @@
      */
     @Test
-    public void testTicket17701() throws Exception {
+    void testTicket17701() throws Exception {
         try (InputStream in = new ByteArrayInputStream(("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                 "<josm-session version=\"0.1\">\n" +
Index: trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java	(revision 17275)
@@ -10,7 +10,7 @@
 import java.util.Map;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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.GpxData;
@@ -38,5 +38,5 @@
  * Unit tests for Session writing.
  */
-public class SessionWriterTest {
+class SessionWriterTest {
 
     protected static final class OsmHeadlessJosExporter extends OsmDataSessionExporter {
@@ -87,5 +87,5 @@
      * Setup tests.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().projection().main();
@@ -94,5 +94,5 @@
      * Setup tests.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         MainApplication.getLayerManager().addLayer(createOsmLayer());
@@ -157,5 +157,5 @@
      */
     @Test
-    public void testWriteEmptyJos() throws IOException {
+    void testWriteEmptyJos() throws IOException {
         testWrite(Collections.<Layer>emptyList(), false);
     }
@@ -166,5 +166,5 @@
      */
     @Test
-    public void testWriteEmptyJoz() throws IOException {
+    void testWriteEmptyJoz() throws IOException {
         testWrite(Collections.<Layer>emptyList(), true);
     }
@@ -175,5 +175,5 @@
      */
     @Test
-    public void testWriteOsmJos() throws IOException {
+    void testWriteOsmJos() throws IOException {
         testWrite(Collections.<Layer>singletonList(createOsmLayer()), false);
     }
@@ -184,5 +184,5 @@
      */
     @Test
-    public void testWriteOsmJoz() throws IOException {
+    void testWriteOsmJoz() throws IOException {
         testWrite(Collections.<Layer>singletonList(createOsmLayer()), true);
     }
@@ -193,5 +193,5 @@
      */
     @Test
-    public void testWriteGpxJos() throws IOException {
+    void testWriteGpxJos() throws IOException {
         testWrite(Collections.<Layer>singletonList(createGpxLayer()), false);
     }
@@ -202,5 +202,5 @@
      */
     @Test
-    public void testWriteGpxJoz() throws IOException {
+    void testWriteGpxJoz() throws IOException {
         testWrite(Collections.<Layer>singletonList(createGpxLayer()), true);
     }
@@ -211,5 +211,5 @@
      */
     @Test
-    public void testWriteGpxAndMarkerJoz() throws IOException {
+    void testWriteGpxAndMarkerJoz() throws IOException {
         GpxLayer gpx = createGpxLayer();
         testWrite(Arrays.asList(gpx, createMarkerLayer(gpx)), true);
@@ -221,5 +221,5 @@
      */
     @Test
-    public void testWriteImageryLayer() throws IOException {
+    void testWriteImageryLayer() throws IOException {
         final Layer layer = createImageryLayer();
         testWrite(Collections.singletonList(layer), true);
@@ -231,5 +231,5 @@
      */
     @Test
-    public void testWriteNoteLayer() throws IOException {
+    void testWriteNoteLayer() throws IOException {
         final Layer layer = createNoteLayer();
         testWrite(Collections.singletonList(layer), true);
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginDownloadExceptionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginDownloadExceptionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginDownloadExceptionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.plugins;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link PluginDownloadException} class.
  */
-public class PluginDownloadExceptionTest {
+class PluginDownloadExceptionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testPluginDownloadException() {
+    void testPluginDownloadException() {
         PluginDownloadException ex = new PluginDownloadException("foo");
         assertEquals("foo", ex.getMessage());
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginExceptionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginExceptionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginExceptionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.plugins;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link PluginException} class.
  */
-public class PluginExceptionTest {
+class PluginExceptionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testPluginDownloadException() {
+    void testPluginDownloadException() {
         PluginException ex = new PluginException("foo");
         assertEquals("foo", ex.getMessage());
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.plugins;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
@@ -17,6 +17,6 @@
 import javax.swing.JScrollPane;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -35,10 +35,10 @@
  * Unit tests of {@link PluginHandler} class.
  */
-public class PluginHandlerTest {
+class PluginHandlerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(DeprecatedPlugin.class).usingGetClass().verify();
@@ -57,5 +57,5 @@
      */
     @Test
-    public void testBuildListOfPluginsToLoad() {
+    void testBuildListOfPluginsToLoad() {
         TestUtils.assumeWorkingJMockit();
         final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testFilterDeprecatedPlugins() {
+    void testFilterDeprecatedPlugins() {
         TestUtils.assumeWorkingJMockit();
         final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker(
@@ -125,5 +125,5 @@
      */
     @Test
-    public void testFilterUnmaintainedPlugins() {
+    void testFilterUnmaintainedPlugins() {
         TestUtils.assumeWorkingJMockit();
         final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(
@@ -152,5 +152,5 @@
      */
     @Test
-    public void testPluginInformationAction() throws PluginException {
+    void testPluginInformationAction() throws PluginException {
         TestUtils.assumeWorkingJMockit();
         final String expectedText = "Ant-Version: Apache Ant 1.9.6\n" +
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.plugins;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.awt.GraphicsEnvironment;
@@ -21,7 +21,7 @@
 import java.util.stream.Collectors;
 
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Preferences;
@@ -59,5 +59,5 @@
      * @throws IOException in case of I/O error
      */
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() throws IOException {
         errorsToIgnore.addAll(TestUtils.getIgnoredErrorMessages(PluginHandlerTestIT.class));
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testValidityOfAvailablePlugins() {
+    void testValidityOfAvailablePlugins() {
         loadAllPlugins();
 
@@ -109,5 +109,5 @@
                 Arrays.toString(layerExceptions.entrySet().toArray()) + '\n'
                 + Arrays.toString(noRestartExceptions.entrySet().toArray());
-        assertTrue(msg, invalidManifestEntries.isEmpty() && loadingExceptions.isEmpty() && layerExceptions.isEmpty());
+        assertTrue(invalidManifestEntries.isEmpty() && loadingExceptions.isEmpty() && layerExceptions.isEmpty(), msg);
     }
 
@@ -254,5 +254,5 @@
         // Restore default timeout
         Config.getPref().putInt("socket.timeout.read", defTimeout);
-        assertTrue(pluginDownloadTask.getFailedPlugins().toString(), pluginDownloadTask.getFailedPlugins().isEmpty());
+        assertTrue(pluginDownloadTask.getFailedPlugins().isEmpty(), pluginDownloadTask.getFailedPlugins()::toString);
         assertEquals(plugins.size(), pluginDownloadTask.getDownloadedPlugins().size());
 
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginListParseExceptionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginListParseExceptionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginListParseExceptionTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.plugins;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,10 +13,10 @@
  * Unit tests of {@link PluginListParseException} class.
  */
-public class PluginListParseExceptionTest {
+class PluginListParseExceptionTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testPluginListParseException() {
+    void testPluginListParseException() {
         NullPointerException npe = new NullPointerException();
         PluginListParseException ex = new PluginListParseException(npe);
Index: trunk/test/unit/org/openstreetmap/josm/spi/lifecycle/LifecycleTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/spi/lifecycle/LifecycleTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/spi/lifecycle/LifecycleTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.spi.lifecycle;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -14,10 +14,10 @@
  * Unit tests of {@link Lifecycle} class.
  */
-public class LifecycleTest {
+class LifecycleTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().https().devAPI().main().projection();
@@ -44,5 +44,5 @@
      */
     @Test
-    public void testSetInitStatusListener() {
+    void testSetInitStatusListener() {
         InitStatusListenerStub listener = new InitStatusListenerStub();
         Lifecycle.setInitStatusListener(listener);
Index: trunk/test/unit/org/openstreetmap/josm/spi/preferences/ListListSettingTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/spi/preferences/ListListSettingTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/spi/preferences/ListListSettingTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.spi.preferences;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,9 +13,9 @@
  * Test {@link ListListSetting}.
  */
-public class ListListSettingTest {
+class ListListSettingTest {
     /**
      * This is a preference test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ListListSetting.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/spi/preferences/ListSettingTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/spi/preferences/ListSettingTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/spi/preferences/ListSettingTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.spi.preferences;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,9 +13,9 @@
  * Test {@link ListSetting}.
  */
-public class ListSettingTest {
+class ListSettingTest {
     /**
      * This is a preference test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(ListSetting.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/spi/preferences/MapListSettingTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/spi/preferences/MapListSettingTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/spi/preferences/MapListSettingTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.spi.preferences;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,9 +13,9 @@
  * Test {@link MapListSetting}.
  */
-public class MapListSettingTest {
+class MapListSettingTest {
     /**
      * This is a preference test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(MapListSetting.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/spi/preferences/StringSettingTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/spi/preferences/StringSettingTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/spi/preferences/StringSettingTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.spi.preferences;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,9 +13,9 @@
  * Test {@link StringSetting}.
  */
-public class StringSettingTest {
+class StringSettingTest {
     /**
      * This is a preference test
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -25,5 +25,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(StringSetting.class).usingGetClass()
Index: trunk/test/unit/org/openstreetmap/josm/testutils/ImagePatternMatching.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/ImagePatternMatching.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/ImagePatternMatching.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.testutils;
 
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.awt.image.BufferedImage;
Index: trunk/test/unit/org/openstreetmap/josm/testutils/mockers/ExtendedDialogMocker.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/mockers/ExtendedDialogMocker.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/mockers/ExtendedDialogMocker.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.testutils.mockers;
 
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.awt.Component;
Index: trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.testutils.mockers;
 
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.awt.Component;
Index: trunk/test/unit/org/openstreetmap/josm/testutils/mockers/JOptionPaneSimpleMocker.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/mockers/JOptionPaneSimpleMocker.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/mockers/JOptionPaneSimpleMocker.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.testutils.mockers;
 
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.awt.Component;
Index: trunk/test/unit/org/openstreetmap/josm/tools/AlphanumComparatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/AlphanumComparatorTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/AlphanumComparatorTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
@@ -8,10 +8,10 @@
 import java.util.List;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link AlphanumComparator}.
  */
-public class AlphanumComparatorTest {
+class AlphanumComparatorTest {
 
     /**
@@ -19,5 +19,5 @@
      */
     @Test
-    public void testNumeric() {
+    void testNumeric() {
         List<String> lst = Arrays.asList("1", "20", "-1", "00999", "100");
         Collections.sort(lst, AlphanumComparator.getInstance());
@@ -29,5 +29,5 @@
      */
     @Test
-    public void testMixed() {
+    void testMixed() {
         List<String> lst = Arrays.asList("b1", "b20", "a5", "a00999", "a100");
         Collections.sort(lst, AlphanumComparator.getInstance());
Index: trunk/test/unit/org/openstreetmap/josm/tools/CheckParameterUtilTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/CheckParameterUtilTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/CheckParameterUtilTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.tools;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -12,10 +12,10 @@
  * Unit tests of {@link CheckParameterUtil} class.
  */
-public class CheckParameterUtilTest {
+class CheckParameterUtilTest {
 
     /**
      * Setup rule.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(CheckParameterUtil.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/tools/ColorHelperTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/ColorHelperTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/ColorHelperTest.java	(revision 17275)
@@ -2,15 +2,15 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.awt.Color;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests for class {@link ColorHelper}.
  */
-public class ColorHelperTest {
+class ColorHelperTest {
 
     /**
@@ -18,5 +18,5 @@
      */
     @Test
-    public void testHtml2color() {
+    void testHtml2color() {
         assertNull(ColorHelper.html2color(""));
         assertNull(ColorHelper.html2color("xyz"));
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testColor2html() {
+    void testColor2html() {
         assertNull(ColorHelper.color2html(null));
         assertEquals("#FF0000", ColorHelper.color2html(Color.RED));
@@ -46,5 +46,5 @@
      */
     @Test
-    public void testGetForegroundColor() {
+    void testGetForegroundColor() {
         assertNull(ColorHelper.getForegroundColor(null));
         assertEquals(Color.WHITE, ColorHelper.getForegroundColor(Color.BLACK));
@@ -59,5 +59,5 @@
      */
     @Test
-    public void testColorFloat2int() {
+    void testColorFloat2int() {
         assertNull(ColorHelper.float2int(null));
         assertEquals(255, (int) ColorHelper.float2int(-1.0f));
@@ -74,5 +74,5 @@
      */
     @Test
-    public void testColorInt2float() {
+    void testColorInt2float() {
         assertNull(ColorHelper.int2float(null));
         assertEquals(1.0f, ColorHelper.int2float(-1), 1e-3);
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testAlphaMultiply() {
+    void testAlphaMultiply() {
         final Color color = new Color(0x12345678, true);
         assertEquals(new Color(0x12345678, true), ColorHelper.alphaMultiply(color, 1f));
@@ -99,5 +99,5 @@
      */
     @Test
-    public void testComplement() {
+    void testComplement() {
         assertEquals(Color.cyan, ColorHelper.complement(Color.red));
         assertEquals(Color.red, ColorHelper.complement(Color.cyan));
Index: trunk/test/unit/org/openstreetmap/josm/tools/ColorScaleTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/ColorScaleTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/ColorScaleTest.java	(revision 17275)
@@ -2,15 +2,15 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.awt.Color;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests for class {@link ColorScale}.
  */
-public class ColorScaleTest {
+class ColorScaleTest {
 
     /**
@@ -18,5 +18,5 @@
      */
     @Test
-    public void testHSBScale() {
+    void testHSBScale() {
         final ColorScale scale = ColorScale.createHSBScale(256);
         assertEquals(new Color(255, 0, 0), scale.getColor(0));
Index: trunk/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.IOException;
@@ -11,7 +11,7 @@
 import java.util.TimeZone;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -31,10 +31,10 @@
  * Unit tests of {@link ExceptionUtil} class.
  */
-public class ExceptionUtilTest {
+class ExceptionUtilTest {
 
     /**
      * Setup rule.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI();
@@ -49,5 +49,5 @@
      * @throws Exception in case of error
      */
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         OsmApi api = OsmApi.getOsmApi();
@@ -63,5 +63,5 @@
      */
     @Test
-    public void testExplainBadRequest() {
+    void testExplainBadRequest() {
         assertEquals("<html>The OSM server '"+baseUrl+"' reported a bad request.<br></html>",
                 ExceptionUtil.explainBadRequest(new OsmApiException("")));
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testExplainBandwidthLimitExceeded() {
+    void testExplainBandwidthLimitExceeded() {
         assertEquals("<html>Communication with the OSM server '"+baseUrl+"'failed. "+
                 "The server replied<br>the following error code and the following error message:<br>"+
@@ -105,5 +105,5 @@
      */
     @Test
-    public void testExplainChangesetClosedException() {
+    void testExplainChangesetClosedException() {
         assertEquals("<html>Failed to upload to changeset <strong>0</strong><br>because it has already been closed on ?.",
                 ExceptionUtil.explainChangesetClosedException(new ChangesetClosedException("")));
@@ -117,5 +117,5 @@
      */
     @Test
-    public void testExplainClientTimeout() {
+    void testExplainClientTimeout() {
         assertEquals("<html>Communication with the OSM server '"+baseUrl+"' timed out. Please retry later.</html>",
                 ExceptionUtil.explainClientTimeout(new OsmApiException("")));
@@ -126,5 +126,5 @@
      */
     @Test
-    public void testExplainConflict() {
+    void testExplainConflict() {
         int code = HttpURLConnection.HTTP_CONFLICT;
         assertEquals("<html>The server reported that it has detected a conflict.</html>",
@@ -146,5 +146,5 @@
      */
     @Test
-    public void testExplainException() {
+    void testExplainException() {
         assertEquals("ResponseCode=0",
                 ExceptionUtil.explainException(new OsmApiException("")));
@@ -161,5 +161,5 @@
      */
     @Test
-    public void testExplainFailedAuthorisation() {
+    void testExplainFailedAuthorisation() {
         assertEquals("<html>Authorisation at the OSM server failed.<br>The server reported the following error:<br>"+
                 "'The server replied an error with code 0.'</html>",
@@ -183,5 +183,5 @@
      */
     @Test
-    public void testExplainFailedOAuthAuthorisation() {
+    void testExplainFailedOAuthAuthorisation() {
         assertEquals("<html>Authorisation at the OSM server with the OAuth token 'null' failed.<br>"+
                 "The token is not authorised to access the protected resource<br>'unknown'.<br>"+
@@ -198,5 +198,5 @@
      */
     @Test
-    public void testExplainFailedBasicAuthentication() {
+    void testExplainFailedBasicAuthentication() {
         assertEquals("<html>Authentication at the OSM server with the username '"+user+"' failed.<br>"+
                 "Please check the username and the password in the JOSM preferences.</html>",
@@ -208,5 +208,5 @@
      */
     @Test
-    public void testExplainFailedOAuthAuthentication() {
+    void testExplainFailedOAuthAuthentication() {
         assertEquals("<html>Authentication at the OSM server with the OAuth token 'null' failed.<br>"+
                 "Please launch the preferences dialog and retrieve another OAuth token.</html>",
@@ -218,5 +218,5 @@
      */
     @Test
-    public void testExplainGenericOsmApiException() {
+    void testExplainGenericOsmApiException() {
         assertEquals("<html>Communication with the OSM server '"+baseUrl+"'failed. The server replied<br>"+
                 "the following error code and the following error message:<br><strong>Error code:<strong> 0<br>"+
@@ -239,5 +239,5 @@
      */
     @Test
-    public void testExplainGoneForUnknownPrimitive() {
+    void testExplainGoneForUnknownPrimitive() {
         assertEquals("<html>The server reports that an object is deleted.<br>"+
                 "<strong>Uploading failed</strong> if you tried to update or delete this object.<br> "+
@@ -251,5 +251,5 @@
      */
     @Test
-    public void testExplainInternalServerError() {
+    void testExplainInternalServerError() {
         assertEquals("<html>The OSM server<br>'"+baseUrl+"'<br>reported an internal server error.<br>"+
                 "This is most likely a temporary problem. Please try again later.</html>",
@@ -261,5 +261,5 @@
      */
     @Test
-    public void testExplainMissingOAuthAccessTokenException() {
+    void testExplainMissingOAuthAccessTokenException() {
         assertEquals("<html>Failed to authenticate at the OSM server 'http://fake.xxx/api'.<br>"+
                 "You are using OAuth to authenticate but currently there is no<br>OAuth Access Token configured.<br>"+
@@ -272,5 +272,5 @@
      */
     @Test
-    public void testExplainNestedIllegalDataException() {
+    void testExplainNestedIllegalDataException() {
         assertEquals("<html>Failed to download data. Its format is either unsupported, ill-formed, and/or inconsistent.<br><br>"+
                 "Details (untranslated): null</html>",
@@ -286,5 +286,5 @@
      */
     @Test
-    public void testExplainNestedIOException() {
+    void testExplainNestedIOException() {
         assertEquals("<html>Failed to upload data to or download data from<br>'"+baseUrl+"'<br>"+
                 "due to a problem with transferring data.<br>Details (untranslated): null</html>",
@@ -300,5 +300,5 @@
      */
     @Test
-    public void testExplainNestedSocketException() {
+    void testExplainNestedSocketException() {
         assertEquals("<html>Failed to open a connection to the remote server<br>'"+baseUrl+"'.<br>"+
                 "Please check your internet connection.</html>",
@@ -310,5 +310,5 @@
      */
     @Test
-    public void testExplainNestedUnknownHostException() {
+    void testExplainNestedUnknownHostException() {
         assertEquals("<html>Failed to open a connection to the remote server<br>'"+baseUrl+"'.<br>"+
                 "Host name '"+host+"' could not be resolved. <br>"+
@@ -321,5 +321,5 @@
      */
     @Test
-    public void testExplainNotFound() {
+    void testExplainNotFound() {
         assertEquals("<html>The OSM server '"+baseUrl+"' does not know about an object<br>"+
                 "you tried to read, update, or delete. Either the respective object<br>"+
@@ -333,5 +333,5 @@
      */
     @Test
-    public void testExplainOfflineAccessException() {
+    void testExplainOfflineAccessException() {
         assertEquals("<html>Failed to download data.<br><br>Details: null</html>",
                 ExceptionUtil.explainOfflineAccessException(new OsmApiException("")));
@@ -344,5 +344,5 @@
      */
     @Test
-    public void testExplainOsmApiInitializationException() {
+    void testExplainOsmApiInitializationException() {
         assertEquals("<html>Failed to initialize communication with the OSM server "+serverUrl+".<br>"+
                 "Check the server URL in your preferences and your internet connection.</html>",
@@ -354,5 +354,5 @@
      */
     @Test
-    public void testExplainOsmTransferException() {
+    void testExplainOsmTransferException() {
         assertEquals("<html>Failed to open a connection to the remote server<br>'"+baseUrl+"'<br>"+
                 "for security reasons. This is most likely because you are running<br>"+
@@ -410,5 +410,5 @@
      */
     @Test
-    public void testExplainPreconditionFailed() {
+    void testExplainPreconditionFailed() {
         int code = HttpURLConnection.HTTP_PRECON_FAILED;
         assertEquals("<html>Uploading to the server <strong>failed</strong> because your current<br>dataset violates a precondition.<br>"+
Index: trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.io.File;
@@ -12,7 +12,7 @@
 import java.util.Date;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+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;
@@ -27,9 +27,9 @@
  * @since 6209
  */
-public class ExifReaderTest {
+class ExifReaderTest {
     /**
      * Set the timezone and timeout.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -40,5 +40,5 @@
      * Setup test
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         directionSampleFile = new File("nodist/data/exif-example_direction.jpg");
@@ -51,5 +51,5 @@
      */
     @Test
-    public void testReadTime() throws ParseException {
+    void testReadTime() throws ParseException {
         Date date = ExifReader.readTime(directionSampleFile);
         doTest("2010-05-15T17:12:05.000", date);
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testReadTimeSubSecond1() throws ParseException {
+    void testReadTimeSubSecond1() throws ParseException {
         Date date = ExifReader.readTime(new File("nodist/data/IMG_20150711_193419.jpg"));
         doTest("2015-07-11T19:34:19.100", date);
@@ -78,5 +78,5 @@
      */
     @Test
-    public void testReadOrientation() {
+    void testReadOrientation() {
         Integer orientation = ExifReader.readOrientation(orientationSampleFile);
         assertEquals(Integer.valueOf(6), orientation);
@@ -87,5 +87,5 @@
      */
     @Test
-    public void testReadLatLon() {
+    void testReadLatLon() {
         LatLon latlon = ExifReader.readLatLon(directionSampleFile);
         assertNotNull(latlon);
@@ -99,5 +99,5 @@
      */
     @Test
-    public void testReadDirection() {
+    void testReadDirection() {
         assertEquals(Double.valueOf(46.5), ExifReader.readDirection(directionSampleFile));
     }
@@ -107,5 +107,5 @@
      */
     @Test
-    public void testReadSpeed() {
+    void testReadSpeed() {
         assertEquals(Double.valueOf(12.3), ExifReader.readSpeed(new File("nodist/data/exif-example_speed_ele.jpg")));
     }
@@ -115,5 +115,5 @@
      */
     @Test
-    public void testReadElevation() {
+    void testReadElevation() {
         assertEquals(Double.valueOf(23.4), ExifReader.readElevation(new File("nodist/data/exif-example_speed_ele.jpg")));
     }
@@ -124,5 +124,5 @@
      */
     @Test
-    public void testTicket11685() throws IOException {
+    void testTicket11685() throws IOException {
         doTestFile("2015-11-08T15:33:27.500", 11685, "2015-11-08_15-33-27-Xiaomi_YI-Y0030832.jpg");
     }
@@ -133,5 +133,5 @@
      */
     @Test
-    public void testTicket14209() throws IOException {
+    void testTicket14209() throws IOException {
         doTestFile("2017-01-16T18:27:00.000", 14209, "0MbEfj1S--.1.jpg");
         doTestFile("2016-08-13T19:51:13.000", 14209, "7VWFOryj--.1.jpg");
Index: trunk/test/unit/org/openstreetmap/josm/tools/FontsManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/FontsManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/FontsManagerTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.awt.Font;
 import java.awt.GraphicsEnvironment;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -17,10 +17,10 @@
  * Unit tests of {@link FontsManager} class.
  */
-public class FontsManagerTest {
+class FontsManagerTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testFontsManager() {
+    void testFontsManager() {
         FontsManager.initialize();
         boolean found = false;
@@ -49,5 +49,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(FontsManager.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/tools/GeoUrlToBoundsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/GeoUrlToBoundsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/GeoUrlToBoundsTest.java	(revision 17275)
@@ -5,11 +5,12 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link GeoUrlToBoundsTest} class.
  */
-public class GeoUrlToBoundsTest {
+class GeoUrlToBoundsTest {
 
     /**
@@ -17,5 +18,5 @@
      */
     @Test
-    public void testParse() {
+    void testParse() {
         assertThat(
                 GeoUrlToBounds.parse("geo:12.34,56.78?z=9"),
@@ -28,5 +29,5 @@
      */
     @Test
-    public void testParseWithoutZoom() {
+    void testParseWithoutZoom() {
         assertThat(
                 GeoUrlToBounds.parse("geo:12.34,56.78"),
@@ -43,5 +44,5 @@
      */
     @Test
-    public void testParseCrsUncertainty() {
+    void testParseCrsUncertainty() {
         assertThat(
                 GeoUrlToBounds.parse("geo:60.00000,17.000000;crs=wgs84"),
@@ -62,5 +63,5 @@
      */
     @Test
-    public void testInvalid() {
+    void testInvalid() {
         assertThat(GeoUrlToBounds.parse("geo:foo"), nullValue());
         assertThat(GeoUrlToBounds.parse("geo:foo,bar"), nullValue());
@@ -70,7 +71,7 @@
      * Tests parsing null.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testNull() {
-        GeoUrlToBounds.parse(null);
+    @Test
+    void testNull() {
+        assertThrows(IllegalArgumentException.class, () -> GeoUrlToBounds.parse(null));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.InputStream;
@@ -15,6 +15,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -35,9 +35,9 @@
  * Unit tests of {@link Geometry} class.
  */
-public class GeometryTest {
+class GeometryTest {
     /**
      * Primitives need preferences and projection.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testLineLineIntersection() {
+    void testLineLineIntersection() {
         EastNorth p1 = new EastNorth(-9477809.106349014, 1.5392960539974203E7);
         EastNorth p2 = new EastNorth(-9477813.789091509, 1.5392954297092048E7);
@@ -81,5 +81,5 @@
      */
     @Test
-    public void testClosedWayArea() throws Exception {
+    void testClosedWayArea() throws Exception {
         try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
@@ -97,5 +97,5 @@
      */
     @Test
-    public void testMultipolygonArea() throws Exception {
+    void testMultipolygonArea() throws Exception {
         try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
@@ -112,5 +112,5 @@
      */
     @Test
-    public void testAreaAndPerimeter() throws Exception {
+    void testAreaAndPerimeter() throws Exception {
         try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "create_multipolygon.osm"))) {
             DataSet ds = OsmReader.parseDataSet(in, null);
@@ -127,5 +127,5 @@
      */
     @Test
-    public void testRightAngle() {
+    void testRightAngle() {
         Node n1 = new Node(1);
         Node n2 = new Node(2);
@@ -159,5 +159,5 @@
      */
     @Test
-    public void testCentroidEN() {
+    void testCentroidEN() {
         EastNorth en1 = new EastNorth(100, 200);
         EastNorth en2 = new EastNorth(150, 400);
@@ -173,5 +173,5 @@
      */
     @Test
-    public void testPolygonIntersectionTriangles() {
+    void testPolygonIntersectionTriangles() {
         Node node1 = new Node(new LatLon(0.0, 1.0));
         Node node2 = new Node(new LatLon(0.0, 2.0));
@@ -204,5 +204,5 @@
      */
     @Test
-    public void testPolygonIntersectionVShapes() {
+    void testPolygonIntersectionVShapes() {
         Node node1 = new Node(new LatLon(1.0, 1.0));
         Node node2 = new Node(new LatLon(2.0, 2.0));
@@ -234,5 +234,5 @@
      */
     @Test
-    public void testIsPolygonInsideMultiPolygon() {
+    void testIsPolygonInsideMultiPolygon() {
         Node node1 = new Node(new LatLon(1.01, 1.0));
         Node node2 = new Node(new LatLon(1.01, 1.1));
@@ -268,5 +268,5 @@
      */
     @Test
-    public void testFilterInsideMultiPolygon() {
+    void testFilterInsideMultiPolygon() {
         Node node1 = new Node(new LatLon(1.01, 1.0));
         Node node2 = new Node(new LatLon(1.01, 1.1));
@@ -310,5 +310,5 @@
      */
     @Test
-    public void testGetDistance() {
+    void testGetDistance() {
         Node node1 = new Node(new LatLon(0, 0));
         Node node2 = new Node(new LatLon(0.1, 1));
@@ -361,5 +361,5 @@
      */
     @Test
-    public void testGetClosestPrimitive() {
+    void testGetClosestPrimitive() {
         Node node1 = new Node(new LatLon(0, 0));
         Node node2 = new Node(new LatLon(0.1, 1));
@@ -380,5 +380,5 @@
      */
     @Test
-    public void testGetFurthestPrimitive() {
+    void testGetFurthestPrimitive() {
         Node node1 = new Node(new LatLon(0, 0));
         Node node2 = new Node(new LatLon(0, 1.1));
@@ -407,5 +407,5 @@
      */
     @Test
-    public void testGetClosestWaySegment() {
+    void testGetClosestWaySegment() {
         Node node1 = new Node(new LatLon(0, 0));
         Node node2 = new Node(new LatLon(0, 1));
@@ -423,5 +423,5 @@
      */
     @Test
-    public void testGetDistanceSegmentSegment() {
+    void testGetDistanceSegmentSegment() {
         Node node1 = new Node(new LatLon(2.0, 2.0));
         Node node2 = new Node(new LatLon(2.0, 3.0));
Index: trunk/test/unit/org/openstreetmap/josm/tools/I18nTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/I18nTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/I18nTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link I18n}.
  */
-public class I18nTest {
+class I18nTest {
 
     /**
@@ -15,5 +15,5 @@
      */
     @Test
-    public void testEscape() {
+    void testEscape() {
         String foobar = "{foo'bar}";
         assertEquals("'{'foo''bar'}'", I18n.escape(foobar));
Index: trunk/test/unit/org/openstreetmap/josm/tools/ImageResizeModeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/ImageResizeModeTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/ImageResizeModeTest.java	(revision 17275)
@@ -8,6 +8,6 @@
 import java.awt.Dimension;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -17,10 +17,10 @@
  * Unit tests of {@link ImageResizeMode} class.
  */
-public class ImageResizeModeTest {
+class ImageResizeModeTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testComputeDimensionAuto() {
+    void testComputeDimensionAuto() {
         assertThrows(IllegalArgumentException.class, () -> ImageResizeMode.AUTO.computeDimension(new Dimension(0, 0), image));
         assertEquals(new Dimension(64, 48), ImageResizeMode.AUTO.computeDimension(ImageResource.DEFAULT_DIMENSION, image));
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testComputeDimensionBounded() {
+    void testComputeDimensionBounded() {
         assertEquals(new Dimension(64, 48), ImageResizeMode.BOUNDED.computeDimension(ImageResource.DEFAULT_DIMENSION, image));
         assertEquals(new Dimension(64, 48), ImageResizeMode.BOUNDED.computeDimension(new Dimension(-1, -1), image));
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testComputeDimensionPadded() {
+    void testComputeDimensionPadded() {
         assertThrows(IllegalArgumentException.class, () -> ImageResizeMode.PADDED.computeDimension(new Dimension(0, 0), image));
         assertThrows(IllegalArgumentException.class, () -> ImageResizeMode.PADDED.computeDimension(ImageResource.DEFAULT_DIMENSION, image));
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testCacheKey() {
+    void testCacheKey() {
         assertEquals(0x00180018, ImageResizeMode.AUTO.cacheKey(ImageProvider.ImageSizes.LARGEICON.getImageDimension()));
         assertEquals(0x10180018, ImageResizeMode.BOUNDED.cacheKey(ImageProvider.ImageSizes.LARGEICON.getImageDimension()));
Index: trunk/test/unit/org/openstreetmap/josm/tools/JosmDecimalFormatSymbolsProviderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/JosmDecimalFormatSymbolsProviderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/JosmDecimalFormatSymbolsProviderTest.java	(revision 17275)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
@@ -10,6 +10,6 @@
 import java.util.stream.Stream;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -19,15 +19,15 @@
  * Unit tests of {@link JosmDecimalFormatSymbolsProvider}.
  */
-public class JosmDecimalFormatSymbolsProviderTest {
+class JosmDecimalFormatSymbolsProviderTest {
 
     /**
      * Setup rule.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
 
     @Test
-    public void testGroupingSeparator() {
+    void testGroupingSeparator() {
         System.out.println(Locale.getDefault());
         assumeTrue(Utils.getJavaVersion() >= 9);
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testParseDouble() {
+    void testParseDouble() {
         final Locale defLocale = Locale.getDefault();
         try {
Index: trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.awt.event.KeyEvent;
@@ -13,6 +13,6 @@
 import java.util.Map.Entry;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -22,9 +22,9 @@
  * Unit tests of {@link KeyboardUtils} class.
  */
-public class KeyboardUtilsTest {
+class KeyboardUtilsTest {
     /**
      * Initializes test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testExtendedCharacters() {
+    void testExtendedCharacters() {
         Map<Integer, Character> map = new LinkedHashMap<>();
         KeyboardUtils.addLatinCharacters(map);
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testGetCharactersForKeyE00() {
+    void testGetCharactersForKeyE00() {
         char deadCircumflex = (char) KeyEvent.VK_DEAD_CIRCUMFLEX;
         char deadCaron = (char) KeyEvent.VK_DEAD_CARON;
Index: trunk/test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java	(revision 17275)
@@ -9,6 +9,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -18,10 +18,10 @@
  * Unit tests of {@link LanguageInfo}.
  */
-public class LanguageInfoTest {
+class LanguageInfoTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().i18n("ca@valencia");
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testWikiLanguagePrefix() {
+    void testWikiLanguagePrefix() {
         testGetWikiLanguagePrefixes(LanguageInfo.LocaleType.DEFAULT,
                 "En:", "De:", "Pt_BR:", "Ca-Valencia:", "Zh_CN:", "Zh_TW:", "Ast:", "En_GB:", "Ru:", "Nb:");
@@ -66,5 +66,5 @@
      */
     @Test
-    public void testGetLocale() {
+    void testGetLocale() {
         Assert.assertEquals(RU, LanguageInfo.getLocale("ru"));
         Assert.assertEquals(EN_GB, LanguageInfo.getLocale("en_GB"));
@@ -79,5 +79,5 @@
      */
     @Test
-    public void testGetJOSMLocaleCode() {
+    void testGetJOSMLocaleCode() {
         Assert.assertEquals("de", LanguageInfo.getJOSMLocaleCode(DE_DE));
         Assert.assertEquals("pt_BR", LanguageInfo.getJOSMLocaleCode(PT_BR));
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testGetJavaLocaleCode() {
+    void testGetJavaLocaleCode() {
         Assert.assertEquals("ca__valencia", LanguageInfo.getJavaLocaleCode("ca@valencia"));
     }
@@ -97,5 +97,5 @@
      */
     @Test
-    public void testGetLanguageCodeXML() {
+    void testGetLanguageCodeXML() {
         Assert.assertEquals("ca-valencia.", LanguageInfo.getLanguageCodeXML());
     }
@@ -105,5 +105,5 @@
      */
     @Test
-    public void testGetLanguageCodeManifest() {
+    void testGetLanguageCodeManifest() {
         Assert.assertEquals("ca-valencia_", LanguageInfo.getLanguageCodeManifest());
     }
@@ -113,5 +113,5 @@
      */
     @Test
-    public void testGetLanguageCodes() {
+    void testGetLanguageCodes() {
         Assert.assertEquals(Arrays.asList("ca_ES@valencia", "ca@valencia", "ca_ES", "ca"), LanguageInfo.getLanguageCodes(CA_ES_VALENCIA));
     }
Index: trunk/test/unit/org/openstreetmap/josm/tools/ListenableWeakReferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/ListenableWeakReferenceTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/ListenableWeakReferenceTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+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.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -19,9 +19,9 @@
  * @since 12181
  */
-public class ListenableWeakReferenceTest {
+class ListenableWeakReferenceTest {
     /**
      * Default test rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -34,5 +34,5 @@
      */
     @Test
-    public void testOnDereference() throws InterruptedException {
+    void testOnDereference() throws InterruptedException {
         object = new Object();
         called = false;
Index: trunk/test/unit/org/openstreetmap/josm/tools/LoggingTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/LoggingTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/LoggingTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+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 java.io.IOException;
@@ -14,7 +14,7 @@
 import java.util.logging.LogRecord;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -24,5 +24,5 @@
  *
  */
-public class LoggingTest {
+class LoggingTest {
 
     private LogRecord captured;
@@ -46,5 +46,5 @@
      * @throws SecurityException if a security error occurs
      */
-    @Before
+    @BeforeEach
     public void setUp() throws SecurityException {
         captured = null;
@@ -55,5 +55,5 @@
      * @throws SecurityException if a security error occurs
      */
-    @After
+    @AfterEach
     public void tearDown() throws SecurityException {
         Logging.getLogger().removeHandler(handler);
@@ -64,5 +64,5 @@
      */
     @Test
-    public void testSetLogLevel() {
+    void testSetLogLevel() {
         Logging.setLogLevel(Logging.LEVEL_DEBUG);
         assertEquals(Logging.LEVEL_DEBUG, Logging.getLogger().getLevel());
@@ -95,5 +95,5 @@
      */
     @Test
-    public void testErrorString() {
+    void testErrorString() {
         testLogCaptured(Logging.LEVEL_ERROR, "test", () -> Logging.error("test"));
     }
@@ -103,5 +103,5 @@
      */
     @Test
-    public void testErrorStringObjectArray() {
+    void testErrorStringObjectArray() {
         testLogCaptured(Logging.LEVEL_ERROR, "test x 1", () -> Logging.error("test {0} {1}", "x", 1));
     }
@@ -111,5 +111,5 @@
      */
     @Test
-    public void testWarnString() {
+    void testWarnString() {
         testLogCaptured(Logging.LEVEL_WARN, "test", () -> Logging.warn("test"));
     }
@@ -119,5 +119,5 @@
      */
     @Test
-    public void testWarnStringObjectArray() {
+    void testWarnStringObjectArray() {
         testLogCaptured(Logging.LEVEL_WARN, "test x 1", () -> Logging.warn("test {0} {1}", "x", 1));
     }
@@ -127,5 +127,5 @@
      */
     @Test
-    public void testInfoString() {
+    void testInfoString() {
         testLogCaptured(Logging.LEVEL_INFO, "test", () -> Logging.info("test"));
     }
@@ -135,5 +135,5 @@
      */
     @Test
-    public void testInfoStringObjectArray() {
+    void testInfoStringObjectArray() {
         testLogCaptured(Logging.LEVEL_INFO, "test x 1", () -> Logging.info("test {0} {1}", "x", 1));
     }
@@ -143,5 +143,5 @@
      */
     @Test
-    public void testDebugString() {
+    void testDebugString() {
         testLogCaptured(Logging.LEVEL_DEBUG, "test", () -> Logging.debug("test"));
     }
@@ -151,5 +151,5 @@
      */
     @Test
-    public void testDebugStringObjectArray() {
+    void testDebugStringObjectArray() {
         testLogCaptured(Logging.LEVEL_DEBUG, "test x 1", () -> Logging.debug("test {0} {1}", "x", 1));
     }
@@ -159,5 +159,5 @@
      */
     @Test
-    public void testTraceString() {
+    void testTraceString() {
         testLogCaptured(Logging.LEVEL_TRACE, "test", () -> Logging.trace("test"));
     }
@@ -167,5 +167,5 @@
      */
     @Test
-    public void testTraceStringObjectArray() {
+    void testTraceStringObjectArray() {
         testLogCaptured(Logging.LEVEL_TRACE, "test x 1", () -> Logging.trace("test {0} {1}", "x", 1));
     }
@@ -175,5 +175,5 @@
      */
     @Test
-    public void testLogLevelThrowable() {
+    void testLogLevelThrowable() {
         testLogCaptured(Logging.LEVEL_ERROR, "java.io.IOException: x", () -> Logging.log(Logging.LEVEL_ERROR, new IOException("x")));
 
@@ -185,5 +185,5 @@
      */
     @Test
-    public void testLogLevelStringThrowable() {
+    void testLogLevelStringThrowable() {
         testLogCaptured(Logging.LEVEL_ERROR, "y: java.io.IOException: x", () -> Logging.log(Logging.LEVEL_ERROR, "y", new IOException("x")));
 
@@ -195,5 +195,5 @@
      */
     @Test
-    public void testLogWithStackTraceLevelThrowable() {
+    void testLogWithStackTraceLevelThrowable() {
         Consumer<String> test = string -> {
             assertTrue(string.startsWith("java.io.IOException: x"));
@@ -215,5 +215,5 @@
      */
     @Test
-    public void testLogWithStackTraceLevelStringThrowable() {
+    void testLogWithStackTraceLevelStringThrowable() {
         Consumer<String> test = string -> {
             assertTrue(string.startsWith("y: java.io.IOException: x"));
@@ -228,5 +228,5 @@
      */
     @Test
-    public void testIsLoggingEnabled() {
+    void testIsLoggingEnabled() {
         Logging.setLogLevel(Logging.LEVEL_ERROR);
         assertTrue(Logging.isLoggingEnabled(Logging.LEVEL_ERROR));
@@ -247,5 +247,5 @@
      */
     @Test
-    public void testClearLastErrorAndWarnings() {
+    void testClearLastErrorAndWarnings() {
         Logging.setLogLevel(Logging.LEVEL_WARN);
         Logging.clearLastErrorAndWarnings();
@@ -261,5 +261,5 @@
      */
     @Test
-    public void testGetLastErrorAndWarnings() {
+    void testGetLastErrorAndWarnings() {
         Logging.setLogLevel(Logging.LEVEL_WARN);
         Logging.clearLastErrorAndWarnings();
@@ -267,5 +267,5 @@
 
         assertEquals(1, Logging.getLastErrorAndWarnings().size());
-        assertTrue(Logging.getLastErrorAndWarnings().toString(), Logging.getLastErrorAndWarnings().get(0).endsWith("W: x"));
+        assertTrue(Logging.getLastErrorAndWarnings().get(0).endsWith("W: x"), Logging.getLastErrorAndWarnings()::toString);
 
         Logging.setLogLevel(Logging.LEVEL_ERROR);
@@ -277,6 +277,6 @@
 
         assertEquals(2, Logging.getLastErrorAndWarnings().size());
-        assertTrue(Logging.getLastErrorAndWarnings().toString(), Logging.getLastErrorAndWarnings().get(0).endsWith("W: x"));
-        assertTrue(Logging.getLastErrorAndWarnings().toString(), Logging.getLastErrorAndWarnings().get(1).endsWith("E: y"));
+        assertTrue(Logging.getLastErrorAndWarnings().get(0).endsWith("W: x"), Logging.getLastErrorAndWarnings()::toString);
+        assertTrue(Logging.getLastErrorAndWarnings().get(1).endsWith("E: y"), Logging.getLastErrorAndWarnings()::toString);
 
         // limit somewhere reasonable
Index: trunk/test/unit/org/openstreetmap/josm/tools/MediawikiTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/MediawikiTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/MediawikiTest.java	(revision 17275)
@@ -2,12 +2,12 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link Mediawiki}.
  */
-public class MediawikiTest {
+class MediawikiTest {
 
     /**
@@ -15,5 +15,5 @@
      */
     @Test
-    public void testImageUrl() {
+    void testImageUrl() {
         assertEquals("https://upload.wikimedia.org/wikipedia/commons/1/18/OpenJDK_logo.svg",
                 Mediawiki.getImageUrl("https://upload.wikimedia.org/wikipedia/commons", "OpenJDK_logo.svg"));
Index: trunk/test/unit/org/openstreetmap/josm/tools/MemoryManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/MemoryManagerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/MemoryManagerTest.java	(revision 17275)
@@ -2,14 +2,15 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 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.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.MemoryManager.MemoryHandle;
@@ -26,5 +27,5 @@
      * Base test environment
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().memoryManagerLeaks();
@@ -35,5 +36,5 @@
      */
     @Test
-    public void testUseMemory() throws NotEnoughMemoryException {
+    void testUseMemory() throws NotEnoughMemoryException {
         MemoryManager manager = MemoryManager.getInstance();
         long available = manager.getAvailableMemory();
@@ -59,10 +60,10 @@
      * @throws NotEnoughMemoryException if there is not enough memory
      */
-    @Test(expected = IllegalStateException.class)
-    public void testUseAfterFree() throws NotEnoughMemoryException {
+    @Test
+    void testUseAfterFree() throws NotEnoughMemoryException {
         MemoryManager manager = MemoryManager.getInstance();
         MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, Object::new);
         testMemory.free();
-        testMemory.get();
+        assertThrows(IllegalStateException.class, () -> testMemory.get());
     }
 
@@ -71,10 +72,10 @@
      * @throws NotEnoughMemoryException if there is not enough memory
      */
-    @Test(expected = IllegalStateException.class)
-    public void testFreeAfterFree() throws NotEnoughMemoryException {
+    @Test
+    void testFreeAfterFree() throws NotEnoughMemoryException {
         MemoryManager manager = MemoryManager.getInstance();
         MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, Object::new);
         testMemory.free();
-        testMemory.free();
+        assertThrows(IllegalStateException.class, () -> testMemory.free());
     }
 
@@ -83,13 +84,13 @@
      * @throws NotEnoughMemoryException always
      */
-    @Test(expected = NotEnoughMemoryException.class)
-    public void testAllocationFails() throws NotEnoughMemoryException {
+    @Test
+    void testAllocationFails() throws NotEnoughMemoryException {
         MemoryManager manager = MemoryManager.getInstance();
         long available = manager.getAvailableMemory();
 
-        manager.allocateMemory("test", available + 1, () -> {
+        assertThrows(NotEnoughMemoryException.class, () -> manager.allocateMemory("test", available + 1, () -> {
             fail("Should not reach");
             return null;
-        });
+        }));
     }
 
@@ -98,9 +99,9 @@
      * @throws NotEnoughMemoryException never
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testSupplierFails() throws NotEnoughMemoryException {
+    @Test
+    void testSupplierFails() throws NotEnoughMemoryException {
         MemoryManager manager = MemoryManager.getInstance();
 
-        manager.allocateMemory("test", 1, () -> null);
+        assertThrows(IllegalArgumentException.class, () -> manager.allocateMemory("test", 1, () -> null));
     }
 
@@ -109,5 +110,5 @@
      */
     @Test
-    public void testIsAvailable() {
+    void testIsAvailable() {
         MemoryManager manager = MemoryManager.getInstance();
         assertTrue(manager.isAvailable(10));
@@ -120,9 +121,9 @@
      * @throws NotEnoughMemoryException never
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testIsAvailableFails() throws NotEnoughMemoryException {
+    @Test
+    void testIsAvailableFails() throws NotEnoughMemoryException {
         MemoryManager manager = MemoryManager.getInstance();
 
-        manager.isAvailable(-10);
+        assertThrows(IllegalArgumentException.class, () -> manager.isAvailable(-10));
     }
 
@@ -132,5 +133,5 @@
      */
     @Test
-    public void testResetState() throws NotEnoughMemoryException {
+    void testResetState() throws NotEnoughMemoryException {
         MemoryManager manager = MemoryManager.getInstance();
         assertTrue(manager.resetState().isEmpty());
@@ -147,11 +148,11 @@
      * @throws NotEnoughMemoryException if there is not enough memory
      */
-    @Test(expected = IllegalStateException.class)
-    public void testResetStateUseAfterFree() throws NotEnoughMemoryException {
+    @Test
+    void testResetStateUseAfterFree() throws NotEnoughMemoryException {
         MemoryManager manager = MemoryManager.getInstance();
         MemoryHandle<Object> testMemory = manager.allocateMemory("test", 10, Object::new);
 
         assertFalse(manager.resetState().isEmpty());
-        testMemory.get();
+        assertThrows(IllegalStateException.class, () -> testMemory.get());
     }
 
@@ -163,5 +164,5 @@
         List<MemoryHandle<?>> hadLeaks = MemoryManager.getInstance().resetState();
         if (!allowMemoryManagerLeaks) {
-            assertTrue("Memory manager had leaking memory: " + hadLeaks, hadLeaks.isEmpty());
+            assertTrue(hadLeaks.isEmpty(), "Memory manager had leaking memory: " + hadLeaks);
         }
     }
Index: trunk/test/unit/org/openstreetmap/josm/tools/MultiMapTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/MultiMapTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/MultiMapTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -13,5 +13,5 @@
 import java.util.Set;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 
@@ -21,5 +21,5 @@
  * Unit tests of {@link MultiMap} class.
  */
-public class MultiMapTest {
+class MultiMapTest {
 
     /**
@@ -27,5 +27,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(MultiMap.class).usingGetClass().verify();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testMultiMap() {
+    void testMultiMap() {
         final MultiMap<String, String> map = new MultiMap<>();
         assertTrue(map.isEmpty());
Index: trunk/test/unit/org/openstreetmap/josm/tools/OptionParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/OptionParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/OptionParserTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -13,6 +13,6 @@
 import java.util.concurrent.atomic.AtomicReference;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.OptionParser.OptionCount;
@@ -25,9 +25,9 @@
  * @author Michael Zangl
  */
-public class OptionParserTest {
+class OptionParserTest {
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().i18n();
@@ -35,5 +35,5 @@
     // A reason for moving to jupiter...
     @Test
-    public void testEmptyParserRejectsLongopt() {
+    void testEmptyParserRejectsLongopt() {
         Exception e = assertThrows(OptionParseException.class, () ->
                 new OptionParser("test").parseOptions(Arrays.asList("--long")));
@@ -42,5 +42,5 @@
 
     @Test
-    public void testEmptyParserRejectsShortopt() {
+    void testEmptyParserRejectsShortopt() {
         Exception e = assertThrows(OptionParseException.class, () ->
                 new OptionParser("test").parseOptions(Arrays.asList("-s")));
@@ -49,5 +49,5 @@
 
     @Test
-    public void testParserRejectsWrongShortopt() {
+    void testParserRejectsWrongShortopt() {
         Exception e = assertThrows(OptionParseException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop).addShortAlias("test", "t")
@@ -57,5 +57,5 @@
 
     @Test
-    public void testParserRejectsWrongLongopt() {
+    void testParserRejectsWrongLongopt() {
         Exception e = assertThrows(OptionParseException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop).parseOptions(Arrays.asList("--wrong")));
@@ -64,5 +64,5 @@
 
     @Test
-    public void testParserOption() {
+    void testParserOption() {
         AtomicReference<String> argFound = new AtomicReference<>();
         OptionParser parser = new OptionParser("test")
@@ -74,5 +74,5 @@
 
     @Test
-    public void testParserOptionFailsIfMissing() {
+    void testParserOptionFailsIfMissing() {
         AtomicReference<String> argFound = new AtomicReference<>();
         OptionParser parser = new OptionParser("test")
@@ -84,5 +84,5 @@
 
     @Test
-    public void testParserOptionFailsIfMissingArgument() {
+    void testParserOptionFailsIfMissingArgument() {
         AtomicReference<String> argFound = new AtomicReference<>();
         OptionParser parser = new OptionParser("test")
@@ -94,5 +94,5 @@
 
     @Test
-    public void testParserOptionFailsIfMissing2() {
+    void testParserOptionFailsIfMissing2() {
         AtomicReference<String> argFound = new AtomicReference<>();
         OptionParser parser = new OptionParser("test")
@@ -104,5 +104,5 @@
 
     @Test
-    public void testParserOptionFailsIfTwice() {
+    void testParserOptionFailsIfTwice() {
         AtomicReference<String> argFound = new AtomicReference<>();
         OptionParser parser = new OptionParser("test")
@@ -114,5 +114,5 @@
 
     @Test
-    public void testParserOptionFailsIfTwiceForAlias() {
+    void testParserOptionFailsIfTwiceForAlias() {
         AtomicReference<String> argFound = new AtomicReference<>();
         OptionParser parser = new OptionParser("test")
@@ -125,5 +125,5 @@
 
     @Test
-    public void testOptionalOptionFailsIfTwice() {
+    void testOptionalOptionFailsIfTwice() {
         OptionParser parser = new OptionParser("test")
                 .addFlagParameter("test", this::nop);
@@ -133,5 +133,5 @@
 
     @Test
-    public void testOptionalOptionFailsIfTwiceForAlias() {
+    void testOptionalOptionFailsIfTwiceForAlias() {
         OptionParser parser = new OptionParser("test")
                 .addFlagParameter("test", this::nop)
@@ -142,5 +142,5 @@
 
     @Test
-    public void testOptionalOptionFailsIfTwiceForAlias2() {
+    void testOptionalOptionFailsIfTwiceForAlias2() {
         OptionParser parser = new OptionParser("test")
                 .addFlagParameter("test", this::nop)
@@ -151,5 +151,5 @@
 
     @Test
-    public void testLongArgumentsUsingEqualSign() {
+    void testLongArgumentsUsingEqualSign() {
         AtomicReference<String> argFound = new AtomicReference<>();
         OptionParser parser = new OptionParser("test")
@@ -173,5 +173,5 @@
 
     @Test
-    public void testLongArgumentsMissingOption() {
+    void testLongArgumentsMissingOption() {
         OptionParser parser = new OptionParser("test")
                 .addArgumentParameter("test", OptionCount.REQUIRED, this::nop);
@@ -182,5 +182,5 @@
 
     @Test
-    public void testLongArgumentsMissingOption2() {
+    void testLongArgumentsMissingOption2() {
         OptionParser parser = new OptionParser("test")
                 .addArgumentParameter("test", OptionCount.REQUIRED, this::nop);
@@ -191,5 +191,5 @@
 
     @Test
-    public void testShortArgumentsMissingOption() {
+    void testShortArgumentsMissingOption() {
         OptionParser parser = new OptionParser("test")
                 .addArgumentParameter("test", OptionCount.REQUIRED, this::nop)
@@ -201,5 +201,5 @@
 
     @Test
-    public void testShortArgumentsMissingOption2() {
+    void testShortArgumentsMissingOption2() {
         OptionParser parser = new OptionParser("test")
                 .addArgumentParameter("test", OptionCount.REQUIRED, this::nop)
@@ -211,5 +211,5 @@
 
     @Test
-    public void testLongFlagHasOption() {
+    void testLongFlagHasOption() {
         OptionParser parser = new OptionParser("test")
                 .addFlagParameter("test", this::nop);
@@ -220,5 +220,5 @@
 
     @Test
-    public void testShortFlagHasOption() {
+    void testShortFlagHasOption() {
         OptionParser parser = new OptionParser("test")
                 .addFlagParameter("test", this::nop)
@@ -230,5 +230,5 @@
 
     @Test
-    public void testShortArgumentsUsingEqualSign() {
+    void testShortArgumentsUsingEqualSign() {
         AtomicReference<String> argFound = new AtomicReference<>();
         OptionParser parser = new OptionParser("test")
@@ -243,5 +243,5 @@
 
     @Test
-    public void testMultipleArguments() {
+    void testMultipleArguments() {
         AtomicReference<String> argFound = new AtomicReference<>();
         List<String> multiFound = new ArrayList<>();
@@ -266,5 +266,5 @@
 
     @Test
-    public void testUseAlternatives() {
+    void testUseAlternatives() {
         AtomicReference<String> argFound = new AtomicReference<>();
         AtomicBoolean usedFlag = new AtomicBoolean();
@@ -285,5 +285,5 @@
 
     @Test
-    public void testAmbiguousAlternatives() {
+    void testAmbiguousAlternatives() {
         AtomicReference<String> argFound = new AtomicReference<>();
         AtomicBoolean usedFlag = new AtomicBoolean();
@@ -300,5 +300,5 @@
 
     @Test
-    public void testMultipleShort() {
+    void testMultipleShort() {
         AtomicReference<String> argFound = new AtomicReference<>();
         AtomicBoolean usedFlag = new AtomicBoolean();
@@ -328,5 +328,5 @@
 
     @Test
-    public void testIllegalOptionName() {
+    void testIllegalOptionName() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("", this::nop));
@@ -335,5 +335,5 @@
 
     @Test
-    public void testIllegalOptionName2() {
+    void testIllegalOptionName2() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("-", this::nop));
@@ -342,5 +342,5 @@
 
     @Test
-    public void testIllegalOptionName3() {
+    void testIllegalOptionName3() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("-test", this::nop));
@@ -349,5 +349,5 @@
 
     @Test
-    public void testIllegalOptionName4() {
+    void testIllegalOptionName4() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("$", this::nop));
@@ -356,5 +356,5 @@
 
     @Test
-    public void testDuplicateOptionName() {
+    void testDuplicateOptionName() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop).addFlagParameter("test", this::nop));
@@ -363,5 +363,5 @@
 
     @Test
-    public void testDuplicateOptionName2() {
+    void testDuplicateOptionName2() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop)
@@ -371,5 +371,5 @@
 
     @Test
-    public void testInvalidShortAlias() {
+    void testInvalidShortAlias() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop).addShortAlias("test", "$"));
@@ -378,5 +378,5 @@
 
     @Test
-    public void testInvalidShortAlias2() {
+    void testInvalidShortAlias2() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop).addShortAlias("test", ""));
@@ -385,5 +385,5 @@
 
     @Test
-    public void testInvalidShortAlias3() {
+    void testInvalidShortAlias3() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop).addShortAlias("test", "xx"));
@@ -392,5 +392,5 @@
 
     @Test
-    public void testDuplicateShortAlias() {
+    void testDuplicateShortAlias() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop)
@@ -402,5 +402,5 @@
 
     @Test
-    public void testInvalidShortNoLong() {
+    void testInvalidShortNoLong() {
         Exception e = assertThrows(IllegalArgumentException.class, () ->
                 new OptionParser("test").addFlagParameter("test", this::nop).addShortAlias("test2", "t"));
Index: trunk/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/OsmPrimitiveImageProviderTest.java	(revision 17275)
@@ -2,8 +2,16 @@
 package org.openstreetmap.josm.tools;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+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 java.awt.Dimension;
+import java.util.EnumSet;
+
+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;
@@ -14,22 +22,15 @@
 import org.openstreetmap.josm.tools.OsmPrimitiveImageProvider.Options;
 
-import java.awt.Dimension;
-import java.util.EnumSet;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import javax.swing.ImageIcon;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
  * Unit tests of {@link OsmPrimitiveImageProvider}
  */
-public class OsmPrimitiveImageProviderTest {
+class OsmPrimitiveImageProviderTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().mapStyles().presets();
@@ -38,5 +39,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -47,5 +48,5 @@
      */
     @Test
-    public void testGetResource() {
+    void testGetResource() {
         TaggingPresetsTest.waitForIconLoading(TaggingPresets.getTaggingPresets());
 
@@ -67,5 +68,5 @@
      */
     @Test
-    public void testGetResourceNonSquare() {
+    void testGetResourceNonSquare() {
         final ImageIcon bankIcon = OsmPrimitiveImageProvider
                 .getResource(OsmUtils.createPrimitive("node amenity=bank"), Options.DEFAULT)
Index: trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java	(revision 17275)
@@ -3,6 +3,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -13,10 +13,10 @@
   * Unit tests of {@link OsmUrlToBounds} class.
 */
-public class OsmUrlToBoundsTest {
+class OsmUrlToBoundsTest {
 
     /**
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testPositionToBounds() {
+    void testPositionToBounds() {
         Assert.assertEquals(new Bounds(51.7167359, 8.7573485, 51.720724, 8.7659315),
                 OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17));
@@ -91,5 +91,5 @@
      */
     @Test
-    public void testParse() {
+    void testParse() {
         for (ParseTestItem item : parseTestData) {
             Bounds bounds = null;
@@ -108,5 +108,5 @@
      */
     @Test
-    public void testGetZoom() {
+    void testGetZoom() {
         Assert.assertEquals(4, OsmUrlToBounds.getZoom(OsmUrlToBounds.positionToBounds(0, 0, 4)));
         Assert.assertEquals(10, OsmUrlToBounds.getZoom(OsmUrlToBounds.positionToBounds(5, 5, 10)));
Index: trunk/test/unit/org/openstreetmap/josm/tools/PairTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/PairTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/PairTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.tools;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 
@@ -11,5 +11,5 @@
  * Unit tests of {@link Pair} class.
  */
-public class PairTest {
+class PairTest {
 
     /**
@@ -17,5 +17,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         EqualsVerifier.forClass(Pair.class).suppress(Warning.NONFINAL_FIELDS).verify();
Index: trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java	(revision 17275)
@@ -2,15 +2,15 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
 import java.io.File;
 import java.io.IOException;
 
-import org.junit.Assume;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.spi.preferences.Config;
@@ -19,5 +19,5 @@
  * Unit tests of {@link PlatformHookOsx} class.
  */
-public class PlatformHookOsxTest {
+class PlatformHookOsxTest {
 
     static PlatformHookOsx hook;
@@ -26,5 +26,5 @@
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testStartupHook() {
+    void testStartupHook() {
         hook.startupHook((a, b, c, d) -> System.out.println("callback"));
     }
@@ -44,5 +44,5 @@
      */
     @Test
-    public void testAfterPrefStartupHook() {
+    void testAfterPrefStartupHook() {
         hook.afterPrefStartupHook();
     }
@@ -53,6 +53,6 @@
      */
     @Test
-    public void testOpenUrl() throws IOException {
-        Assume.assumeTrue(PlatformManager.isPlatformOsx());
+    void testOpenUrl() throws IOException {
+        assumeTrue(PlatformManager.isPlatformOsx());
         hook.openUrl(Config.getUrls().getJOSMWebsite());
     }
@@ -62,5 +62,5 @@
      */
     @Test
-    public void testGetDefaultCacheDirectory() {
+    void testGetDefaultCacheDirectory() {
         File cache = hook.getDefaultCacheDirectory();
         assertNotNull(cache);
@@ -74,5 +74,5 @@
      */
     @Test
-    public void testGetDefaultPrefDirectory() {
+    void testGetDefaultPrefDirectory() {
         File cache = hook.getDefaultPrefDirectory();
         assertNotNull(cache);
@@ -86,5 +86,5 @@
      */
     @Test
-    public void testGetDefaultStyle() {
+    void testGetDefaultStyle() {
         assertEquals("com.apple.laf.AquaLookAndFeel", hook.getDefaultStyle());
     }
@@ -94,5 +94,5 @@
      */
     @Test
-    public void testGetOSDescription() {
+    void testGetOSDescription() {
         String os = hook.getOSDescription();
         if (PlatformManager.isPlatformOsx()) {
@@ -107,5 +107,5 @@
      */
     @Test
-    public void testInitSystemShortcuts() {
+    void testInitSystemShortcuts() {
         hook.initSystemShortcuts();
     }
Index: trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookTestIT.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.io.StringReader;
@@ -10,6 +10,6 @@
 import javax.json.Json;
 
-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.testutils.JOSMTestRules;
 
@@ -19,10 +19,10 @@
  * Integration tests of {@link PlatformHook} class.
  */
-public class PlatformHookTestIT {
+class PlatformHookTestIT {
 
     /**
      * Setup rule
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -33,10 +33,11 @@
      */
     @Test
-    public void testLatestUbuntuVersion() throws Exception {
+    void testLatestUbuntuVersion() throws Exception {
         String latestUbuntuVersion = Json.createReader(new StringReader(HttpClient.create(
                 new URL("https://api.launchpad.net/devel/ubuntu/series")).connect().fetchContent()))
                 .readObject().getJsonArray("entries").getJsonObject(0).getString("name");
-        assertEquals(latestUbuntuVersion, HttpURLConnection.HTTP_OK, HttpClient.create(
-                new URL("https://josm.openstreetmap.de/apt/dists/" + latestUbuntuVersion + '/')).connect().getResponseCode());
+        assertEquals(HttpURLConnection.HTTP_OK, HttpClient.create(
+                new URL("https://josm.openstreetmap.de/apt/dists/" + latestUbuntuVersion + '/')).connect().getResponseCode(),
+                latestUbuntuVersion);
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java	(revision 17275)
@@ -30,5 +30,5 @@
  * Unit tests of {@link PlatformHookWindows} class.
  */
-public class PlatformHookWindowsTest {
+class PlatformHookWindowsTest {
 
     /**
@@ -53,5 +53,5 @@
      */
     @Test
-    public void testStartupHook() {
+    void testStartupHook() {
         hook.startupHook((a, b, c, d) -> System.out.println("callback"));
     }
@@ -62,5 +62,5 @@
      */
     @Test
-    public void testGetRootKeystore() throws Exception {
+    void testGetRootKeystore() throws Exception {
         if (PlatformManager.isPlatformWindows()) {
             assertNotNull(PlatformHookWindows.getRootKeystore());
@@ -79,5 +79,5 @@
      */
     @Test
-    public void testAfterPrefStartupHook() {
+    void testAfterPrefStartupHook() {
         hook.afterPrefStartupHook();
     }
@@ -89,5 +89,5 @@
      */
     @Test
-    public void testOpenUrlSuccess(@Mocked final Desktop mockDesktop) throws IOException {
+    void testOpenUrlSuccess(@Mocked final Desktop mockDesktop) throws IOException {
         TestUtils.assumeWorkingJMockit();
         new Expectations() {{
@@ -107,5 +107,5 @@
      */
     @Test
-    public void testOpenUrlFallback(@Mocked final Desktop mockDesktop, @Mocked Runtime anyRuntime) throws IOException {
+    void testOpenUrlFallback(@Mocked final Desktop mockDesktop, @Mocked Runtime anyRuntime) throws IOException {
         TestUtils.assumeWorkingJMockit();
         new Expectations() {{
@@ -130,5 +130,5 @@
      */
     @Test
-    public void testGetAdditionalFonts() {
+    void testGetAdditionalFonts() {
         assertFalse(hook.getAdditionalFonts().isEmpty());
     }
@@ -138,5 +138,5 @@
      */
     @Test
-    public void testGetDefaultCacheDirectory() {
+    void testGetDefaultCacheDirectory() {
         File cache = hook.getDefaultCacheDirectory();
         assertNotNull(cache);
@@ -150,5 +150,5 @@
      */
     @Test
-    public void testGetDefaultPrefDirectory() {
+    void testGetDefaultPrefDirectory() {
         File cache = hook.getDefaultPrefDirectory();
         assertNotNull(cache);
@@ -162,5 +162,5 @@
      */
     @Test
-    public void testGetDefaultStyle() {
+    void testGetDefaultStyle() {
         assertEquals("com.sun.java.swing.plaf.windows.WindowsLookAndFeel", hook.getDefaultStyle());
     }
@@ -170,5 +170,5 @@
      */
     @Test
-    public void testGetInstalledFonts() {
+    void testGetInstalledFonts() {
         Collection<String> fonts = hook.getInstalledFonts();
         if (PlatformManager.isPlatformWindows()) {
@@ -183,5 +183,5 @@
      */
     @Test
-    public void testGetOSDescription() {
+    void testGetOSDescription() {
         String os = hook.getOSDescription();
         if (PlatformManager.isPlatformWindows()) {
@@ -196,5 +196,5 @@
      */
     @Test
-    public void testInitSystemShortcuts() {
+    void testInitSystemShortcuts() {
         hook.initSystemShortcuts();
     }
Index: trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java	(revision 17275)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -15,9 +15,9 @@
  * Unit tests of {@link RightAndLefthandTraffic} class.
  */
-public class RightAndLefthandTrafficTest {
+class RightAndLefthandTrafficTest {
     /**
      * Test rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules().projection().territories();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(RightAndLefthandTraffic.class);
     }
@@ -36,5 +36,5 @@
      */
     @Test
-    public void testIsRightHandTraffic() {
+    void testIsRightHandTraffic() {
         check(true, "Paris", 48.8567, 2.3508);
         check(true, "Berlin", 52.5167, 13.383);
Index: trunk/test/unit/org/openstreetmap/josm/tools/RotationAngleTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/RotationAngleTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/RotationAngleTest.java	(revision 17275)
@@ -2,12 +2,13 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests of {@link RotationAngle} class.
  */
-public class RotationAngleTest {
+class RotationAngleTest {
 
     private static final double EPSILON = 1e-11;
@@ -17,5 +18,5 @@
      */
     @Test
-    public void testParseCardinal() {
+    void testParseCardinal() {
         assertEquals(Math.PI, RotationAngle.buildStaticRotation("south").getRotationAngle(null), EPSILON);
         assertEquals(Math.PI, RotationAngle.buildStaticRotation("s").getRotationAngle(null), EPSILON);
@@ -26,7 +27,7 @@
      * Unit test of method {@link RotationAngle#buildStaticRotation} - wrong parameter.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testParseFail() {
-        RotationAngle.buildStaticRotation("bad");
+    @Test
+    void testParseFail() {
+        assertThrows(IllegalArgumentException.class, () -> RotationAngle.buildStaticRotation("bad"));
     }
 
@@ -34,7 +35,7 @@
      * Unit test of method {@link RotationAngle#buildStaticRotation} - null handling.
      */
-    @Test(expected = NullPointerException.class)
-    public void testParseNull() {
-        RotationAngle.buildStaticRotation(null);
+    @Test
+    void testParseNull() {
+        assertThrows(NullPointerException.class, () -> RotationAngle.buildStaticRotation(null));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/tools/SearchCompilerQueryWizardTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/SearchCompilerQueryWizardTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/SearchCompilerQueryWizardTest.java	(revision 17275)
@@ -2,9 +2,10 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -14,9 +15,9 @@
  * Unit tests of {@link SearchCompilerQueryWizard} class.
  */
-public class SearchCompilerQueryWizardTest {
+class SearchCompilerQueryWizardTest {
     /**
      * Base test environment is enough
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().i18n("de");
@@ -41,5 +42,5 @@
      */
     @Test
-    public void testKeyValue() {
+    void testKeyValue() {
         assertQueryEquals("  nwr[\"amenity\"=\"drinking_water\"];\n", "amenity=drinking_water");
         assertQueryEquals("  nwr[\"amenity\"];\n", "amenity=*");
@@ -50,5 +51,5 @@
      */
     @Test
-    public void testKeyNotValue() {
+    void testKeyNotValue() {
         assertQueryEquals("  nwr[\"amenity\"!=\"drinking_water\"];\n", "-amenity=drinking_water");
         assertQueryEquals("  nwr[!\"amenity\"];\n", "-amenity=*");
@@ -59,5 +60,5 @@
      */
     @Test
-    public void testKeyLikeValue() {
+    void testKeyLikeValue() {
         assertQueryEquals("  nwr[\"foo\"~\"bar\"];\n", "foo~bar");
         assertQueryEquals("  nwr[\"foo\"~\"bar\"];\n", "foo~/bar/");
@@ -73,5 +74,5 @@
      */
     @Test
-    public void testOsmBoolean() {
+    void testOsmBoolean() {
         assertQueryEquals("  nwr[\"highway\"][\"oneway\"~\"true|yes|1|on\"];\n", "highway=* AND oneway?");
         assertQueryEquals("  nwr[\"highway\"][\"oneway\"~\"false|no|0|off\"];\n", "highway=* AND -oneway?");
@@ -82,5 +83,5 @@
      */
     @Test
-    public void testBooleanAnd() {
+    void testBooleanAnd() {
         assertQueryEquals("  nwr[\"foo\"=\"bar\"][\"baz\"=\"42\"];\n", "foo=bar and baz=42");
         assertQueryEquals("  nwr[\"foo\"=\"bar\"][\"baz\"=\"42\"];\n", "foo=bar && baz=42");
@@ -92,5 +93,5 @@
      */
     @Test
-    public void testBooleanOr() {
+    void testBooleanOr() {
         assertQueryEquals("  nwr[\"foo\"=\"bar\"];\n  nwr[\"baz\"=\"42\"];\n", "foo=bar or baz=42");
         assertQueryEquals("  nwr[\"foo\"=\"bar\"];\n  nwr[\"baz\"=\"42\"];\n", "foo=bar | baz=42");
@@ -101,5 +102,5 @@
      */
     @Test
-    public void testBoolean() {
+    void testBoolean() {
         assertQueryEquals("" +
                 "  nwr[\"foo\"][\"baz1\"];\n" +
@@ -118,5 +119,5 @@
      */
     @Test
-    public void testType() {
+    void testType() {
         assertQueryEquals("  node[\"foo\"=\"bar\"];\n  way[\"foo\"=\"bar\"];\n", "foo=bar and (type:node or type:way)");
     }
@@ -126,5 +127,5 @@
      */
     @Test
-    public void testUser() {
+    void testUser() {
         assertQueryEquals("  nwr(user:\"foo\");\n  nwr(uid:42);\n", "user:foo or user:42");
     }
@@ -134,5 +135,5 @@
      */
     @Test
-    public void testEmpty() {
+    void testEmpty() {
         assertQueryEquals("  way[\"foo\"~\"^$\"];\n", "foo=\"\" and type:way");
     }
@@ -142,5 +143,5 @@
      */
     @Test
-    public void testInArea() {
+    void testInArea() {
         String query = constructQuery("foo=bar | foo=baz in Innsbruck");
         assertEquals("" +
@@ -179,5 +180,5 @@
      */
     @Test
-    public void testAroundArea() {
+    void testAroundArea() {
         final String query = constructQuery("foo=bar | foo=baz around \"Sankt Sigmund im Sellrain\"");
         assertEquals("" +
@@ -196,5 +197,5 @@
      */
     @Test
-    public void testGlobal() {
+    void testGlobal() {
         final String query = constructQuery("foo=bar global");
         assertEquals("" +
@@ -211,5 +212,5 @@
      */
     @Test
-    public void testInBbox() {
+    void testInBbox() {
         assertQueryEquals("  nwr[\"foo\"=\"bar\"];\n", "foo=bar IN BBOX");
     }
@@ -219,6 +220,6 @@
      */
     @Test
-    @Ignore("preset handling not implemented")
-    public void testPreset() {
+    @Disabled("preset handling not implemented")
+    void testPreset() {
         assertQueryEquals("  nwr[\"amenity\"=\"hospital\"];\n", "Hospital");
     }
@@ -227,7 +228,7 @@
      * Test erroneous value.
      */
-    @Test(expected = UncheckedParseException.class)
-    public void testErroneous() {
-        constructQuery("-(foo or bar)");
+    @Test
+    void testErroneous() {
+        assertThrows(UncheckedParseException.class, () -> constructQuery("-(foo or bar)"));
     }
 
@@ -236,5 +237,5 @@
      */
     @Test
-    public void testTicket19151() {
+    void testTicket19151() {
         assertQueryEquals("  relation[\"type\"=\"multipolygon\"][!\"landuse\"][!\"area:highway\"];\n",
                 "type:relation and type=multipolygon and -landuse=* and -\"area:highway\"=*");
Index: trunk/test/unit/org/openstreetmap/josm/tools/ShortcutTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/ShortcutTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/ShortcutTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.awt.event.InputEvent;
@@ -9,6 +9,6 @@
 import javax.swing.KeyStroke;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 
@@ -16,10 +16,10 @@
  * Unit tests of {@link Shortcut} class.
  */
-public class ShortcutTest {
+class ShortcutTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -30,5 +30,5 @@
      */
     @Test
-    public void testMakeTooltip() {
+    void testMakeTooltip() {
         final String tooltip = Shortcut.makeTooltip("Foo Bar", KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.SHIFT_DOWN_MASK));
         if (Platform.determinePlatform() == Platform.OSX) {
Index: trunk/test/unit/org/openstreetmap/josm/tools/StreamUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/StreamUtilsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/StreamUtilsTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.tools;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
@@ -17,10 +17,10 @@
  * Unit tests of {@link StreamUtils} class.
  */
-public class StreamUtilsTest {
+class StreamUtilsTest {
 
     /**
      * Setup rule.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(StreamUtils.class);
     }
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testReverseStream() {
+    void testReverseStream() {
         assertEquals("baz/bar/foo",
                 StreamUtils.reversedStream(Arrays.asList("foo", "bar", "baz")).collect(Collectors.joining("/")));
Index: trunk/test/unit/org/openstreetmap/josm/tools/StringParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/StringParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/StringParserTest.java	(revision 17275)
@@ -4,10 +4,11 @@
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Optional;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import net.trajano.commons.testing.UtilityClassTestUtil;
@@ -16,5 +17,5 @@
  * Unit tests of {@link StringParser} class.
  */
-public class StringParserTest {
+class StringParserTest {
 
     /**
@@ -24,5 +25,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(Utils.class);
     }
@@ -32,5 +33,5 @@
      */
     @Test
-    public void testParse() {
+    void testParse() {
         assertThat(StringParser.DEFAULT.parse(char.class, "josm"), is('j'));
         assertThat(StringParser.DEFAULT.parse(short.class, "123"), is((short) 123));
@@ -44,7 +45,7 @@
      * Tests that {@link StringParser#DEFAULT} is immutable.
      */
-    @Test(expected = UnsupportedOperationException.class)
-    public void testDefaultImmutable() {
-        StringParser.DEFAULT.registerParser(String.class, String::valueOf);
+    @Test
+    void testDefaultImmutable() {
+        assertThrows(UnsupportedOperationException.class, () -> StringParser.DEFAULT.registerParser(String.class, String::valueOf));
     }
 
@@ -53,5 +54,5 @@
      */
     @Test
-    public void testCopyConstructor() {
+    void testCopyConstructor() {
         final StringParser parser = new StringParser(StringParser.DEFAULT).registerParser(boolean.class, "JOSM"::equals);
         assertTrue(StringParser.DEFAULT.parse(boolean.class, "true"));
Index: trunk/test/unit/org/openstreetmap/josm/tools/Tag2LinkTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/Tag2LinkTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/Tag2LinkTest.java	(revision 17275)
@@ -7,6 +7,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -16,5 +16,5 @@
  * Test {@link Tag2Link}
  */
-public class Tag2LinkTest {
+class Tag2LinkTest {
 
     List<String> links = new ArrayList<>();
@@ -31,5 +31,5 @@
      * Setup test.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testInitialize() {
+    void testInitialize() {
         Tag2Link.initialize();
         Assert.assertTrue("obtains at least 40 rules", Tag2Link.wikidataRules.size() > 40);
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testName() {
+    void testName() {
         Tag2Link.getLinksForTag("name", "foobar", this::addLink);
         checkLinks("Search on duckduckgo.com // https://duckduckgo.com/?q=foobar",
@@ -58,5 +58,5 @@
      */
     @Test
-    public void testWebsite() {
+    void testWebsite() {
         Tag2Link.getLinksForTag("website", "http://www.openstreetmap.org/", this::addLink);
         checkLinks("Open openstreetmap.org // http://www.openstreetmap.org/");
@@ -73,5 +73,5 @@
      */
     @Test
-    public void testWikipedia() {
+    void testWikipedia() {
         Tag2Link.getLinksForTag("wikipedia", "de:Wohnhausgruppe Herderstraße", this::addLink);
         checkLinks("View Wikipedia article // https://de.wikipedia.org/wiki/Wohnhausgruppe_Herderstraße");
@@ -85,5 +85,5 @@
      */
     @Test
-    public void testImageCommonsImage() {
+    void testImageCommonsImage() {
         Tag2Link.getLinksForTag("image", "File:Witten Brücke Gasstraße.jpg", this::addLink);
         checkLinks("View image on Wikimedia Commons // https://commons.wikimedia.org/wiki/File:Witten Brücke Gasstraße.jpg");
@@ -99,5 +99,5 @@
      */
     @Test
-    public void testImageCommonsCategory() {
+    void testImageCommonsCategory() {
         Tag2Link.getLinksForTag("image", "category:JOSM", this::addLink);
         checkLinks("View category on Wikimedia Commons // https://commons.wikimedia.org/wiki/category:JOSM");
@@ -108,5 +108,5 @@
      */
     @Test
-    public void testBrandWikidata() {
+    void testBrandWikidata() {
         Tag2Link.getLinksForTag("brand:wikidata", "Q259340", this::addLink);
         checkLinks("View Wikidata item // https://www.wikidata.org/wiki/Q259340");
@@ -117,5 +117,5 @@
      */
     @Test
-    public void testArchipelagoWikidata() {
+    void testArchipelagoWikidata() {
         Tag2Link.getLinksForTag("archipelago:wikidata", "Q756987;Q756988", this::addLink);
         checkLinks("View Wikidata item // https://www.wikidata.org/wiki/Q756987",
Index: trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java	(revision 17275)
@@ -3,7 +3,7 @@
 
 import static java.util.Collections.singleton;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
@@ -13,6 +13,6 @@
 import java.util.Set;
 
-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.TestUtils;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -25,9 +25,9 @@
  * Unit tests of {@link Territories} class.
  */
-public class TerritoriesTest {
+class TerritoriesTest {
     /**
      * Test rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules().projection().territories();
@@ -39,5 +39,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(Territories.class);
     }
@@ -47,5 +47,5 @@
      */
     @Test
-    public void testIsIso3166Code() {
+    void testIsIso3166Code() {
         check("Paris", new LatLon(48.8567, 2.3508), "EU", "FR", "FX");
     }
@@ -53,5 +53,5 @@
     private static void check(String name, LatLon ll, String... expectedCodes) {
         for (String e : expectedCodes) {
-            assertTrue(name + " " + e, Territories.isIso3166Code(e, ll));
+            assertTrue(Territories.isIso3166Code(e, ll), name + " " + e);
         }
     }
@@ -61,5 +61,5 @@
      */
     @Test
-    public void testTaginfoGeofabrik_nominal() {
+    void testTaginfoGeofabrik_nominal() {
         Territories.initializeExternalData("foo", TestUtils.getTestDataRoot() + "/taginfo/geofabrik-index-v1-nogeom.json");
         Map<String, TaginfoRegionalInstance> cache = Territories.taginfoGeofabrikCache;
@@ -86,5 +86,5 @@
      */
     @Test
-    public void testTaginfoGeofabrik_broken() {
+    void testTaginfoGeofabrik_broken() {
         Logging.clearLastErrorAndWarnings();
         Territories.initializeExternalData("foo", TestUtils.getTestDataRoot() + "taginfo/geofabrik-index-v1-nogeom-broken.json");
@@ -92,6 +92,6 @@
         assertTrue(cache.isEmpty());
         String error = Logging.getLastErrorAndWarnings().get(0);
-        assertTrue(error, error.contains("W: Failed to parse external taginfo data at "));
-        assertTrue(error, error.contains(": Invalid token=EOF at (line no=3,"));
+        assertTrue(error.contains("W: Failed to parse external taginfo data at "), error);
+        assertTrue(error.contains(": Invalid token=EOF at (line no=3,"), error);
     }
 
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testGetCustomTags() {
+    void testGetCustomTags() {
         assertNull(Territories.getCustomTags(null));
         assertNull(Territories.getCustomTags("foo"));
Index: trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTestIT.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
 import java.util.Collections;
 
-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.testutils.JOSMTestRules;
 
@@ -16,10 +16,10 @@
  * Integration tests of {@link Territories} class.
  */
-public class TerritoriesTestIT {
+class TerritoriesTestIT {
 
     /**
      * Test rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules().projection();
@@ -30,12 +30,12 @@
      */
     @Test
-    public void testUtilityClass() {
+    void testUtilityClass() {
         Logging.clearLastErrorAndWarnings();
         Territories.initialize();
-        assertEquals("no errors or warnings", Collections.emptyList(), Logging.getLastErrorAndWarnings());
-        assertFalse("customTagsCache is non empty", Territories.customTagsCache.isEmpty());
-        assertFalse("iso3166Cache is non empty", Territories.iso3166Cache.isEmpty());
-        assertFalse("taginfoCache is non empty", Territories.taginfoCache.isEmpty());
-        assertFalse("taginfoGeofabrikCache is non empty", Territories.taginfoGeofabrikCache.isEmpty());
+        assertEquals(Collections.emptyList(), Logging.getLastErrorAndWarnings(), "no errors or warnings");
+        assertFalse(Territories.customTagsCache.isEmpty(), "customTagsCache is non empty");
+        assertFalse(Territories.iso3166Cache.isEmpty(), "iso3166Cache is non empty");
+        assertFalse(Territories.taginfoCache.isEmpty(), "taginfoCache is non empty");
+        assertFalse(Territories.taginfoGeofabrikCache.isEmpty(), "taginfoGeofabrikCache is non empty");
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java	(revision 17275)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.ArrayList;
@@ -11,6 +11,6 @@
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -20,9 +20,9 @@
  * Unit tests of {@link TextTagParser} class.
  */
-public class TextTagParserTest {
+class TextTagParserTest {
     /**
      * Some of this depends on preferences.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -32,5 +32,5 @@
      */
     @Test
-    public void testUnescape() {
+    void testUnescape() {
         String s, s1;
         s = "\"2 3 4\"";
@@ -55,5 +55,5 @@
      */
     @Test
-    public void testTNformat() {
+    void testTNformat() {
         String txt = "   a  \t  1   \n\n\n  b\t2 \n c \t the value with \"quotes\"";
         Map<String, String> correctTags = new HashMap<String, String>() { {
@@ -68,5 +68,5 @@
      */
     @Test
-    public void testEQformat() {
+    void testEQformat() {
         String txt = "key1=value key2=\"long value\" tag3=\"hotel \\\"Quote\\\"\"";
         Map<String, String> correctTags = new HashMap<String, String>() { {
@@ -82,5 +82,5 @@
      */
     @Test
-    public void testJSONformat() {
+    void testJSONformat() {
         String txt;
         Map<String, String> tags, correctTags;
@@ -105,5 +105,5 @@
      */
     @Test
-    public void testFreeformat() {
+    void testFreeformat() {
         String txt = "a 1 b=2 c=\"hello === \\\"\\\"world\"";
         Map<String, String> correctTags = new HashMap<String, String>() { {
@@ -118,5 +118,5 @@
      */
     @Test
-    public void testErrorDetect() {
+    void testErrorDetect() {
         String txt = "a=2 b=3 4";
         Map<String, String> tags = TextTagParser.readTagsFromText(txt);
@@ -128,5 +128,5 @@
      */
     @Test
-    public void testTab() {
+    void testTab() {
         assertEquals(Collections.singletonMap("shop", "jewelry"), TextTagParser.readTagsFromText("shop\tjewelry"));
         assertEquals(Collections.singletonMap("shop", "jewelry"), TextTagParser.readTagsFromText("!shop\tjewelry"));
@@ -139,5 +139,5 @@
      */
     @Test
-    public void testTicket16104() {
+    void testTicket16104() {
         Map<String, String> expected = new HashMap<>();
         expected.put("boundary", "national_park");
@@ -170,5 +170,5 @@
      */
     @Test
-    public void testTicket8384Comment58() {
+    void testTicket8384Comment58() {
         Map<String, String> expected = new HashMap<>();
         expected.put("name", "Main street");
@@ -181,5 +181,5 @@
      */
     @Test
-    public void testStableOrder() {
+    void testStableOrder() {
         List<String> expected = Arrays.asList("foo4", "foo3", "foo2", "foo1");
         ArrayList<String> actual = new ArrayList<>(TextTagParser.readTagsByRegexp(
Index: trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 17275)
@@ -2,9 +2,10 @@
 package org.openstreetmap.josm.tools;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.File;
@@ -21,6 +22,6 @@
 import java.util.regex.Pattern;
 
-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.testutils.JOSMTestRules;
 
@@ -31,9 +32,9 @@
  * Unit tests of {@link Utils} class.
  */
-public class UtilsTest {
+class UtilsTest {
     /**
      * Use default, basic test rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules();
@@ -44,5 +45,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(Utils.class);
     }
@@ -52,5 +53,5 @@
      */
     @Test
-    public void testStrip() {
+    void testStrip() {
         // CHECKSTYLE.OFF: SingleSpaceSeparator
         final String someWhite =
@@ -107,5 +108,5 @@
      */
     @Test
-    public void testIsStripEmpty() {
+    void testIsStripEmpty() {
         assertTrue(Utils.isStripEmpty(null));
         assertTrue(Utils.isStripEmpty(""));
@@ -123,5 +124,5 @@
      */
     @Test
-    public void testToHexString() {
+    void testToHexString() {
         assertEquals("", Utils.toHexString(null));
         assertEquals("", Utils.toHexString(new byte[0]));
@@ -137,5 +138,5 @@
      */
     @Test
-    public void testPositionListString() {
+    void testPositionListString() {
         assertEquals("1", Utils.getPositionListString(Arrays.asList(1)));
         assertEquals("1-2", Utils.getPositionListString(Arrays.asList(1, 2)));
@@ -150,5 +151,5 @@
      */
     @Test
-    public void testDurationString() {
+    void testDurationString() {
         I18n.set("en");
         assertEquals("0 ms", Utils.getDurationString(0));
@@ -169,7 +170,7 @@
      * Test of {@link Utils#getDurationString} method.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testDurationStringNegative() {
-        Utils.getDurationString(-1);
+    @Test
+    void testDurationStringNegative() {
+        assertThrows(IllegalArgumentException.class, () -> Utils.getDurationString(-1));
     }
 
@@ -178,5 +179,5 @@
      */
     @Test
-    public void testEscapeReservedCharactersHTML() {
+    void testEscapeReservedCharactersHTML() {
         assertEquals("foo -&gt; bar -&gt; '&amp;'", Utils.escapeReservedCharactersHTML("foo -> bar -> '&'"));
     }
@@ -186,5 +187,5 @@
      */
     @Test
-    public void testShortenString() {
+    void testShortenString() {
         assertNull(Utils.shortenString(null, 3));
         assertEquals("...", Utils.shortenString("123456789", 3));
@@ -200,7 +201,7 @@
      * Test of {@link Utils#shortenString} method.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testShortenStringTooShort() {
-        Utils.shortenString("123456789", 2);
+    @Test
+    void testShortenStringTooShort() {
+        assertThrows(IllegalArgumentException.class, () -> Utils.shortenString("123456789", 2));
     }
 
@@ -209,5 +210,5 @@
      */
     @Test
-    public void testRestrictStringLines() {
+    void testRestrictStringLines() {
         assertNull(Utils.restrictStringLines(null, 2));
         assertEquals("1\n...", Utils.restrictStringLines("1\n2\n3", 2));
@@ -220,5 +221,5 @@
      */
     @Test
-    public void testLimit() {
+    void testLimit() {
         assertNull(Utils.limit(null, 2, "..."));
         assertEquals(Arrays.asList("1", "..."), Utils.limit(Arrays.asList("1", "2", "3"), 2, "..."));
@@ -231,5 +232,5 @@
      */
     @Test
-    public void testSizeString() {
+    void testSizeString() {
         assertEquals("0 B", Utils.getSizeString(0, Locale.ENGLISH));
         assertEquals("123 B", Utils.getSizeString(123, Locale.ENGLISH));
@@ -251,7 +252,7 @@
      * Test of {@link Utils#getSizeString} method.
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testSizeStringNegative() {
-        Utils.getSizeString(-1, Locale.ENGLISH);
+    @Test
+    void testSizeStringNegative() {
+        assertThrows(IllegalArgumentException.class, () -> Utils.getSizeString(-1, Locale.ENGLISH));
     }
 
@@ -260,5 +261,5 @@
      */
     @Test
-    public void testJoinAsHtmlUnorderedList() {
+    void testJoinAsHtmlUnorderedList() {
         List<? extends Object> items = Arrays.asList("1", Integer.valueOf(2));
         assertEquals("<ul><li>1</li><li>2</li></ul>", Utils.joinAsHtmlUnorderedList(items));
@@ -270,5 +271,5 @@
      */
     @Test
-    public void testGetJavaVersion() {
+    void testGetJavaVersion() {
         String javaVersion = System.getProperty("java.version");
         try {
@@ -302,5 +303,5 @@
      */
     @Test
-    public void testGetJavaUpdate() {
+    void testGetJavaUpdate() {
         String javaVersion = System.getProperty("java.version");
         try {
@@ -331,5 +332,5 @@
      */
     @Test
-    public void testGetJavaBuild() {
+    void testGetJavaBuild() {
         String javaVersion = System.getProperty("java.runtime.version");
         try {
@@ -363,6 +364,6 @@
      */
     @Test
-    public void testNullStreamForReadBytesFromStream() throws IOException {
-        assertEquals("Empty on null stream", 0, Utils.readBytesFromStream(null).length);
+    void testNullStreamForReadBytesFromStream() throws IOException {
+        assertEquals(0, Utils.readBytesFromStream(null).length, "Empty on null stream");
     }
 
@@ -371,5 +372,5 @@
      */
     @Test
-    public void testLevenshteinDistance() {
+    void testLevenshteinDistance() {
         assertEquals(0, Utils.getLevenshteinDistance("foo", "foo"));
         assertEquals(3, Utils.getLevenshteinDistance("foo", "bar"));
@@ -384,5 +385,5 @@
      */
     @Test
-    public void testIsSimilar() {
+    void testIsSimilar() {
         assertFalse(Utils.isSimilar("foo", "foo"));
         assertFalse(Utils.isSimilar("foo", "bar"));
@@ -396,5 +397,5 @@
      */
     @Test
-    public void testStripHtml() {
+    void testStripHtml() {
         assertEquals("Hoogte 55 m", Utils.stripHtml(
                 "<table width=\"100%\"><tr>" +
@@ -407,5 +408,5 @@
      */
     @Test
-    public void testFirstNonNull() {
+    void testFirstNonNull() {
         assertNull(Utils.firstNonNull());
         assertNull(Utils.firstNonNull(null, null));
@@ -417,5 +418,5 @@
      */
     @Test
-    public void testGetMatches() {
+    void testGetMatches() {
         final Pattern pattern = Pattern.compile("(foo)x(bar)y(baz)");
         assertNull(Utils.getMatches(pattern.matcher("")));
@@ -427,5 +428,5 @@
      */
     @Test
-    public void testEncodeUrl() {
+    void testEncodeUrl() {
         assertEquals("%C3%A4%C3%B6%C3%BC%C3%9F", Utils.encodeUrl("äöüß"));
     }
@@ -434,7 +435,7 @@
      * Test of {@link Utils#encodeUrl}
      */
-    @Test(expected = NullPointerException.class)
-    public void testEncodeUrlNull() {
-        Utils.encodeUrl(null);
+    @Test
+    void testEncodeUrlNull() {
+        assertThrows(NullPointerException.class, () -> Utils.encodeUrl(null));
     }
 
@@ -443,5 +444,5 @@
      */
     @Test
-    public void testDecodeUrl() {
+    void testDecodeUrl() {
         assertEquals("äöüß", Utils.decodeUrl("%C3%A4%C3%B6%C3%BC%C3%9F"));
     }
@@ -450,7 +451,7 @@
      * Test of {@link Utils#decodeUrl}
      */
-    @Test(expected = NullPointerException.class)
-    public void testDecodeUrlNull() {
-        Utils.decodeUrl(null);
+    @Test
+    void testDecodeUrlNull() {
+        assertThrows(NullPointerException.class, () -> Utils.decodeUrl(null));
     }
 
@@ -459,5 +460,5 @@
      */
     @Test
-    public void testClamp() {
+    void testClamp() {
         assertEquals(3, Utils.clamp(2, 3, 5));
         assertEquals(3, Utils.clamp(3, 3, 5));
@@ -475,7 +476,7 @@
      * Test of {@link Utils#clamp}
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testClampIAE1() {
-        Utils.clamp(0, 5, 4);
+    @Test
+    void testClampIAE1() {
+        assertThrows(IllegalArgumentException.class, () -> Utils.clamp(0, 5, 4));
     }
 
@@ -483,7 +484,7 @@
      * Test of {@link Utils#clamp}
      */
-    @Test(expected = IllegalArgumentException.class)
-    public void testClampIAE2() {
-        Utils.clamp(0., 5., 4.);
+    @Test
+    void testClampIAE2() {
+        assertThrows(IllegalArgumentException.class, () -> Utils.clamp(0., 5., 4.));
     }
 
@@ -492,5 +493,5 @@
      */
     @Test
-    public void testHasExtension() {
+    void testHasExtension() {
         assertFalse(Utils.hasExtension("JOSM.txt"));
         assertFalse(Utils.hasExtension("JOSM.txt", "jpg"));
@@ -504,5 +505,5 @@
      */
     @Test
-    public void testToUnmodifiableList() {
+    void testToUnmodifiableList() {
         assertSame(Collections.emptyList(), Utils.toUnmodifiableList(null));
         assertSame(Collections.emptyList(), Utils.toUnmodifiableList(Collections.emptyList()));
@@ -518,5 +519,5 @@
      */
     @Test
-    public void testToUnmodifiableMap() {
+    void testToUnmodifiableMap() {
         assertSame(Collections.emptyMap(), Utils.toUnmodifiableMap(null));
         assertSame(Collections.emptyMap(), Utils.toUnmodifiableMap(Collections.emptyMap()));
@@ -538,5 +539,5 @@
      */
     @Test
-    public void testExecOutput() throws Exception {
+    void testExecOutput() throws Exception {
         final String output = Utils.execOutput(Arrays.asList("echo", "Hello", "World"));
         assertEquals("Hello World", output);
Index: trunk/test/unit/org/openstreetmap/josm/tools/XmlUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/XmlUtilsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/XmlUtilsTest.java	(revision 17275)
@@ -3,6 +3,6 @@
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -20,17 +20,17 @@
 import java.io.StringWriter;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * Unit tests of {@link XmlUtils} class.
  */
-public class XmlUtilsTest {
+class XmlUtilsTest {
 
     /**
      * Use default, basic test rules.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules();
@@ -40,5 +40,5 @@
 
     @Test
-    public void testExternalEntitiesParsingDom() throws IOException, ParserConfigurationException {
+    void testExternalEntitiesParsingDom() throws IOException, ParserConfigurationException {
         try {
             final String source = TestUtils.getTestDataRoot() + "dom_external_entity.xml";
@@ -52,5 +52,5 @@
 
     @Test
-    public void testExternalEntitiesTransformer() throws IOException {
+    void testExternalEntitiesTransformer() throws IOException {
         try {
             final String source = TestUtils.getTestDataRoot() + "dom_external_entity.xml";
@@ -65,5 +65,5 @@
 
     @Test
-    public void testExternalEntitiesSaxParser() throws IOException, ParserConfigurationException {
+    void testExternalEntitiesSaxParser() throws IOException, ParserConfigurationException {
         try {
             final String source = TestUtils.getTestDataRoot() + "dom_external_entity.xml";
Index: trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java	(revision 17275)
@@ -4,6 +4,6 @@
 import java.util.concurrent.CountDownLatch;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -13,9 +13,9 @@
  * Unit tests of {@link BugReportExceptionHandler} class.
  */
-public class BugReportExceptionHandlerTest {
+class BugReportExceptionHandlerTest {
     /**
      * No dependencies
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -26,5 +26,5 @@
      */
     @Test
-    public void testHandleException() throws InterruptedException {
+    void testHandleException() throws InterruptedException {
         CountDownLatch latch = new CountDownLatch(1);
         BugReportQueue.getInstance().addBugReportHandler(e -> {
Index: trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java	(revision 17275)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.tools.bugreport;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
@@ -10,6 +10,6 @@
 import java.io.StringWriter;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.actions.ShowStatusReportAction;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -21,9 +21,9 @@
  * @author Michael Zangl
  */
-public class BugReportTest {
+class BugReportTest {
     /**
      * Preferences for the report text
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -33,5 +33,5 @@
      */
     @Test
-    public void testReportText() {
+    void testReportText() {
         ReportedException e = interceptInChildMethod(new IOException("test-exception-message"));
         e.put("test-key", "test-value");
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testIntercept() {
+    void testIntercept() {
         IOException base = new IOException("test");
         ReportedException intercepted = interceptInChildMethod(base);
@@ -69,5 +69,5 @@
      */
     @Test
-    public void testGetCallingMethod() {
+    void testGetCallingMethod() {
         assertEquals("BugReportTest#testGetCallingMethod", BugReport.getCallingMethod(1));
         assertEquals("BugReportTest#testGetCallingMethod", testGetCallingMethod2());
Index: trunk/test/unit/org/openstreetmap/josm/tools/bugreport/ReportedExceptionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/bugreport/ReportedExceptionTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/bugreport/ReportedExceptionTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.tools.bugreport;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.Arrays;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
@@ -13,5 +13,5 @@
  * @since 10285
  */
-public class ReportedExceptionTest {
+class ReportedExceptionTest {
     private static final class CauseOverwriteException extends RuntimeException {
         private Throwable myCause;
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testPutDoesHandleNull() {
+    void testPutDoesHandleNull() {
         ReportedException e = new ReportedException(new RuntimeException());
         e.startSection("test");
@@ -45,5 +45,5 @@
      */
     @Test
-    public void testPutDoesNotThrow() {
+    void testPutDoesNotThrow() {
         ReportedException e = new ReportedException(new RuntimeException());
         e.startSection("test");
@@ -65,5 +65,5 @@
      */
     @Test
-    public void testIsSame() {
+    void testIsSame() {
         // Do not break this line! All exceptions need to be created in the same line.
         // CHECKSTYLE.OFF: LineLength
@@ -78,5 +78,5 @@
                 boolean is01 = (i == 0 || i == 1) && (j == 0 || j == 1);
                 boolean is23 = (i == 2 || i == 3) && (j == 2 || j == 3);
-                assertEquals(i + ", " + j, is01 || is23 || i == j, testExceptions[i].isSame(testExceptions[j]));
+                assertEquals(is01 || is23 || i == j, testExceptions[i].isSame(testExceptions[j]), i + ", " + j);
             }
         }
Index: trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java	(revision 17275)
@@ -2,9 +2,10 @@
 package org.openstreetmap.josm.tools.date;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.text.DateFormat;
@@ -14,7 +15,7 @@
 import java.util.concurrent.ForkJoinPool;
 
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.UncheckedParseException;
@@ -33,5 +34,5 @@
      * Timeouts need to be disabled because we change the time zone.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().i18n().preferences();
@@ -42,5 +43,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(DateUtils.class);
     }
@@ -58,5 +59,5 @@
      */
     @Test
-    public void testMapDate() {
+    void testMapDate() {
         assertEquals(1344870637000L, DateUtils.fromString("2012-08-13T15:10:37Z").getTime());
     }
@@ -66,5 +67,5 @@
      */
     @Test
-    public void testNoteDate() {
+    void testNoteDate() {
         assertEquals(1417298930000L, DateUtils.fromString("2014-11-29 22:08:50 UTC").getTime());
     }
@@ -74,5 +75,5 @@
      */
     @Test
-    public void testExifDate() {
+    void testExifDate() {
         assertEquals(1443038712000L, DateUtils.fromString("2015:09:23 20:05:12").getTime());
         assertEquals(1443038712888L, DateUtils.fromString("2015:09:23 20:05:12.888").getTime());
@@ -83,5 +84,5 @@
      */
     @Test
-    public void testGPXDate() {
+    void testGPXDate() {
         assertEquals(1277465405000L, DateUtils.fromString("2010-06-25T11:30:05.000Z").getTime());
     }
@@ -91,5 +92,5 @@
      */
     @Test
-    public void testRfc3339() {
+    void testRfc3339() {
         // examples taken from RFC
         assertEquals(482196050520L, DateUtils.fromString("1985-04-12T23:20:50.52Z").getTime());
@@ -105,7 +106,7 @@
      * Verifies that parsing an illegal date throws a {@link UncheckedParseException}
      */
-    @Test(expected = UncheckedParseException.class)
-    public void testIllegalDate() {
-        DateUtils.fromString("2014-");
+    @Test
+    void testIllegalDate() {
+        assertThrows(UncheckedParseException.class, () -> DateUtils.fromString("2014-"));
     }
 
@@ -114,5 +115,5 @@
      */
     @Test
-    public void testFormattingMillisecondsDoesNotCauseIncorrectParsing() {
+    void testFormattingMillisecondsDoesNotCauseIncorrectParsing() {
         DateUtils.fromDate(new Date(123));
         assertEquals(1453694709000L, DateUtils.fromString("2016-01-25T04:05:09.000Z").getTime());
@@ -125,5 +126,5 @@
      */
     @Test
-    public void testFromTimestamp() {
+    void testFromTimestamp() {
         assertEquals("1970-01-01T00:00:00Z", DateUtils.fromTimestamp(0));
         assertEquals("2001-09-09T01:46:40Z", DateUtils.fromTimestamp(1000000000));
@@ -135,5 +136,5 @@
      */
     @Test
-    public void testFromDate() {
+    void testFromDate() {
         assertEquals("1970-01-01T00:00:00Z", DateUtils.fromDate(new Date(0)));
         assertEquals("1970-01-01T00:00:00.1Z", DateUtils.fromDate(new Date(100)));
@@ -147,5 +148,5 @@
      */
     @Test
-    public void testFormatTime() {
+    void testFormatTime() {
         assertEquals("12:00 AM", DateUtils.formatTime(new Date(0), DateFormat.SHORT));
         assertEquals("1:00 AM", DateUtils.formatTime(new Date(60 * 60 * 1000), DateFormat.SHORT));
@@ -162,5 +163,5 @@
      */
     @Test
-    public void testFormatDate() {
+    void testFormatDate() {
         assertEquals("1/1/70", DateUtils.formatDate(new Date(123), DateFormat.SHORT));
         assertEquals("January 1, 1970", DateUtils.formatDate(new Date(123), DateFormat.LONG));
@@ -171,5 +172,5 @@
      */
     @Test
-    public void testTsFromString() {
+    void testTsFromString() {
         // UTC times
         assertEquals(1459641600000L, DateUtils.tsFromString("2016-04-03"));
@@ -204,6 +205,6 @@
 
     @Test
-    @Ignore("slow; use for thread safety testing")
-    public void testTsFromString800k() throws Exception {
+    @Disabled("slow; use for thread safety testing")
+    void testTsFromString800k() throws Exception {
         new ForkJoinPool(64).submit(() -> new Random()
                 .longs(800_000)
@@ -215,7 +216,7 @@
      * Unit test of {@link DateUtils#tsFromString} method.
      */
-    @Test(expected = UncheckedParseException.class)
-    public void testTsFromStringInvalid1() {
-        DateUtils.tsFromString("foobar");
+    @Test
+    void testTsFromStringInvalid1() {
+        assertThrows(UncheckedParseException.class, () -> DateUtils.tsFromString("foobar"));
     }
 
@@ -223,7 +224,7 @@
      * Unit test of {@link DateUtils#tsFromString} method.
      */
-    @Test(expected = UncheckedParseException.class)
-    public void testTsFromStringInvalid2() {
-        DateUtils.tsFromString("2016/04/03");
+    @Test
+    void testTsFromStringInvalid2() {
+        assertThrows(UncheckedParseException.class, () -> DateUtils.tsFromString("2016/04/03"));
     }
 
@@ -232,5 +233,5 @@
      */
     @Test
-    public void testGetDateFormat() {
+    void testGetDateFormat() {
         Boolean iso = DateUtils.PROP_ISO_DATES.get();
         try {
@@ -250,5 +251,5 @@
      */
     @Test
-    public void testTimeFormat() {
+    void testTimeFormat() {
         Boolean iso = DateUtils.PROP_ISO_DATES.get();
         try {
@@ -265,5 +266,5 @@
 
     @Test
-    public void testCloneDate() {
+    void testCloneDate() {
         assertNull(DateUtils.cloneDate(null));
         final Date date = new Date(1453694709000L);
Index: trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEntryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEntryTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEntryTest.java	(revision 17275)
@@ -5,6 +5,6 @@
 
 import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -18,10 +18,10 @@
  * Unit tests of {@link TemplateEntry} class.
  */
-public class TemplateEntryTest {
+class TemplateEntryTest {
 
     /**
      * Setup rule.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -31,5 +31,5 @@
      */
     @Test
-    public void testEqualsContract() {
+    void testEqualsContract() {
         TestUtils.assumeWorkingEqualsVerifier();
         Set<Class<? extends TemplateEntry>> templates = TestUtils.getJosmSubtypes(TemplateEntry.class);
Index: trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateParserTest.java	(revision 17269)
+++ trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateParserTest.java	(revision 17275)
@@ -2,5 +2,6 @@
 package org.openstreetmap.josm.tools.template_engine;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Arrays;
@@ -8,6 +9,6 @@
 
 import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.data.osm.Node;
@@ -22,10 +23,10 @@
  * Unit tests of {@link TemplateParser} class.
  */
-public class TemplateParserTest {
+class TemplateParserTest {
 
     /**
      * Setup test.
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         JOSMFixture.createUnitTestFixture().init();
@@ -37,5 +38,5 @@
      */
     @Test
-    public void testEmpty() throws ParseError {
+    void testEmpty() throws ParseError {
         TemplateParser parser = new TemplateParser("");
         assertEquals(new StaticText(""), parser.parse());
@@ -47,5 +48,5 @@
      */
     @Test
-    public void testVariable() throws ParseError {
+    void testVariable() throws ParseError {
         TemplateParser parser = new TemplateParser("abc{var}\\{ef\\$\\{g");
         assertEquals(CompoundTemplateEntry.fromArray(new StaticText("abc"),
@@ -58,5 +59,5 @@
      */
     @Test
-    public void testConditionWhitespace() throws ParseError {
+    void testConditionWhitespace() throws ParseError {
         TemplateParser parser = new TemplateParser("?{ '{name} {desc}' | '{name}' | '{desc}'    }");
         Condition condition = new Condition(Arrays.asList(
@@ -72,5 +73,5 @@
      */
     @Test
-    public void testConditionNoWhitespace() throws ParseError {
+    void testConditionNoWhitespace() throws ParseError {
         TemplateParser parser = new TemplateParser("?{'{name} {desc}'|'{name}'|'{desc}'}");
         Condition condition = new Condition(Arrays.asList(
@@ -91,5 +92,5 @@
      */
     @Test
-    public void testConditionSearchExpression() throws ParseError, SearchParseError {
+    void testConditionSearchExpression() throws ParseError, SearchParseError {
         TemplateParser parser = new TemplateParser("?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' |  '{admin_level}'}");
         Condition condition = new Condition(Arrays.asList(
@@ -139,5 +140,5 @@
      */
     @Test
-    public void testFilling() throws ParseError {
+    void testFilling() throws ParseError {
         TemplateParser parser = new TemplateParser("{name} u{unknown}u i{number}i");
         TemplateEntry entry = parser.parse();
@@ -152,5 +153,5 @@
      */
     @Test
-    public void testFillingSearchExpression() throws ParseError {
+    void testFillingSearchExpression() throws ParseError {
         TemplateParser parser = new TemplateParser("?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' |  '{admin_level}'}");
         TemplateEntry templateEntry = parser.parse();
@@ -173,5 +174,5 @@
      */
     @Test
-    public void testPrintAll() throws ParseError {
+    void testPrintAll() throws ParseError {
         TemplateParser parser = new TemplateParser("{special:everything}");
         TemplateEntry entry = parser.parse();
@@ -187,5 +188,5 @@
      */
     @Test
-    public void testPrintMultiline() throws ParseError {
+    void testPrintMultiline() throws ParseError {
         TemplateParser parser = new TemplateParser("{name}\\n{number}");
         TemplateEntry entry = parser.parse();
@@ -200,5 +201,5 @@
      */
     @Test
-    public void testSpecialVariable() throws ParseError {
+    void testSpecialVariable() throws ParseError {
         TemplateParser parser = new TemplateParser("{name}u{special:localName}u{special:special:key}");
         TemplateEntry templateEntry = parser.parse();
@@ -210,5 +211,5 @@
 
     @Test
-    public void testSearchExpression() throws Exception {
+    void testSearchExpression() throws Exception {
         compile("(parent type=type1 type=parent1) | (parent type=type2 type=parent2)");
         //"parent(type=type1,type=parent1) | (parent(type=type2,type=parent2)"
@@ -221,5 +222,5 @@
      */
     @Test
-    public void testSwitchContext() throws ParseError {
+    void testSwitchContext() throws ParseError {
         TemplateParser parser = new TemplateParser("!{parent() type=parent2 '{name}'}");
         DatasetFactory ds = new DatasetFactory();
@@ -242,5 +243,5 @@
 
     @Test
-    public void testSetAnd() throws ParseError {
+    void testSetAnd() throws ParseError {
         TemplateParser parser = new TemplateParser("!{(parent(type=child) type=parent) & (parent type=child subtype=parent) '{name}'}");
         DatasetFactory ds = new DatasetFactory();
@@ -261,5 +262,5 @@
 
     @Test
-    public void testSetOr() throws ParseError {
+    void testSetOr() throws ParseError {
         TemplateParser parser = new TemplateParser("!{(parent(type=type1) type=parent1) | (parent type=type2 type=parent2) '{name}'}");
         DatasetFactory ds = new DatasetFactory();
@@ -288,5 +289,5 @@
 
     @Test
-    public void testMultilevel() throws ParseError {
+    void testMultilevel() throws ParseError {
         TemplateParser parser = new TemplateParser(
                 "!{(parent(parent(type=type1)) type=grandparent) | (parent type=type2 type=parent2) '{name}'}");
@@ -320,18 +321,18 @@
     }
 
-    @Test(expected = ParseError.class)
-    public void testErrorsNot() throws ParseError {
+    @Test
+    void testErrorsNot() {
         TemplateParser parser = new TemplateParser("!{-parent() '{name}'}");
-        parser.parse();
-    }
-
-    @Test(expected = ParseError.class)
-    public void testErrorOr() throws ParseError {
+        assertThrows(ParseError.class, () -> parser.parse());
+    }
+
+    @Test
+    void testErrorOr() {
         TemplateParser parser = new TemplateParser("!{parent() | type=type1 '{name}'}");
-        parser.parse();
-    }
-
-    @Test
-    public void testChild() throws ParseError {
+        assertThrows(ParseError.class, () -> parser.parse());
+    }
+
+    @Test
+    void testChild() throws ParseError {
         TemplateParser parser = new TemplateParser("!{((child(type=type1) type=child1) | (child type=type2 type=child2)) type=child2 '{name}'}");
         DatasetFactory ds = new DatasetFactory();
@@ -351,5 +352,4 @@
         parent2.addMember(new RelationMember("", child2));
 
-
         StringBuilder sb = new StringBuilder();
         TemplateEntry entry = parser.parse();
@@ -360,5 +360,5 @@
 
     @Test
-    public void testToStringCanBeParsedAgain() throws Exception {
+    void testToStringCanBeParsedAgain() throws Exception {
         final String s1 = "?{ '{name} ({desc})' | '{name} ({cmt})' | '{name}' | '{desc}' | '{cmt}' }";
         final String s2 = new TemplateParser(s1).parse().toString();
