Index: /trunk/ivy.xml
===================================================================
--- /trunk/ivy.xml	(revision 17089)
+++ /trunk/ivy.xml	(revision 17090)
@@ -51,5 +51,5 @@
         </dependency>
         <!-- jmockit->default - Don't upgrade JMockit until https://josm.openstreetmap.de/ticket/18200 is resolved -->
-        <dependency conf="jmockit->default" org="org.jmockit" name="jmockit" rev="1.44"/>
+        <dependency conf="jmockit->default" org="org.jmockit" name="jmockit" rev="1.49"/>
         <!-- test->default -->
         <dependency conf="test->default" org="com.github.spotbugs" name="spotbugs-annotations" rev="4.0.1"/>
Index: /trunk/src/org/openstreetmap/josm/gui/MapViewState.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapViewState.java	(revision 17089)
+++ /trunk/src/org/openstreetmap/josm/gui/MapViewState.java	(revision 17090)
@@ -132,5 +132,11 @@
     }
 
-    private static Point findTopLeftInWindow(JComponent position) {
+    /**
+     * This is visible for JMockit.
+     *
+     * @param position The component to get the top left position of its window
+     * @return the top left point in window
+     */
+    static Point findTopLeftInWindow(JComponent position) {
         Point result = new Point();
         // better than using swing utils, since this allows us to use the method if no screen is present.
@@ -144,5 +150,11 @@
     }
 
-    private static Point findTopLeftOnScreen(JComponent position) {
+    /**
+     * This is visible for JMockit.
+     *
+     * @param position The component to get the top left position of its screen
+     * @return the top left point on screen
+     */
+    static Point findTopLeftOnScreen(JComponent position) {
         try {
             return position.getLocationOnScreen();
Index: /trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 17089)
+++ /trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 17090)
@@ -204,5 +204,11 @@
     }
 
-    private static void handleEDTException(Throwable t) {
+    /**
+     * Handle exceptions in the EDT. This should only be used in {@link GuiHelper}
+     * and {@code org.openstreetmap.josm.testutils.mockers.EDTAssertionMocker}.
+     *
+     * @param t The throwable to handle
+     */
+    static void handleEDTException(Throwable t) {
         Logging.logWithStackTrace(Logging.LEVEL_ERROR, t, "Exception raised in EDT");
     }
Index: /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/EDTAssertionMocker.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/EDTAssertionMocker.java	(revision 17089)
+++ /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/EDTAssertionMocker.java	(revision 17090)
@@ -14,5 +14,5 @@
 public class EDTAssertionMocker extends MockUp<GuiHelper> {
     @Mock
-    private static void handleEDTException(final Invocation invocation, final Throwable t) {
+    static void handleEDTException(final Invocation invocation, final Throwable t) throws Throwable {
         final Throwable cause = t.getCause();
         if (cause instanceof AssertionError) {
Index: /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/ExtendedDialogMocker.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/ExtendedDialogMocker.java	(revision 17089)
+++ /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/ExtendedDialogMocker.java	(revision 17090)
@@ -6,17 +6,18 @@
 import java.awt.Component;
 import java.awt.GraphicsEnvironment;
+import java.lang.reflect.Field;
 import java.util.Arrays;
 import java.util.Map;
+import java.util.NoSuchElementException;
 import java.util.Optional;
 import java.util.WeakHashMap;
 
+import org.junit.platform.commons.util.ReflectionUtils;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.Logging;
 
-import mockit.Deencapsulation;
 import mockit.Invocation;
 import mockit.Mock;
-import mockit.internal.reflection.FieldReflection;
 
 /**
@@ -77,5 +78,6 @@
 
     protected int getButtonPositionFromLabel(final ExtendedDialog instance, final String label) {
-        final String[] bTexts = Deencapsulation.getField(instance, "bTexts");
+        final String[] bTexts = (String[]) ReflectionUtils.tryToReadFieldValue(ExtendedDialog.class, "bTexts", instance)
+                .toOptional().orElseThrow(NoSuchElementException::new);
         final int position = Arrays.asList(bTexts).indexOf(label);
         if (position == -1) {
@@ -151,5 +153,5 @@
 
     @Mock
-    private void setVisible(final Invocation invocation, final boolean value) {
+    private void setVisible(final Invocation invocation, final boolean value) throws Throwable {
         if (value == true) {
             try {
@@ -158,5 +160,7 @@
                 final int mockResult = this.getMockResult(instance);
                 // TODO check validity of mockResult?
-                FieldReflection.setField(instance.getClass(), instance, "result", mockResult);
+                Field resultField = instance.getClass().getDeclaredField("result");
+                resultField.setAccessible(true);
+                resultField.set(instance, mockResult);
                 Logging.info(
                     "{0} answering {1} to ExtendedDialog with content {2}",
@@ -166,5 +170,5 @@
                 );
                 this.getInvocationLogInternal().add(this.getInvocationLogEntry(instance, mockResult));
-            } catch (AssertionError e) {
+            } catch (AssertionError | NoSuchFieldException | IllegalAccessException e) {
                 // in case this exception gets ignored by the calling thread we want to signify this failure
                 // in the invocation log. it's hard to know what to add to the log in these cases as it's
Index: /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/WindowlessMapViewStateMocker.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/WindowlessMapViewStateMocker.java	(revision 17089)
+++ /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/WindowlessMapViewStateMocker.java	(revision 17090)
@@ -17,10 +17,10 @@
 public class WindowlessMapViewStateMocker extends MockUp<MapViewState> {
     @Mock
-    private static Point findTopLeftInWindow(JComponent position) {
+    static Point findTopLeftInWindow(JComponent position) {
         return new Point();
     }
 
     @Mock
-    private static Point findTopLeftOnScreen(JComponent position) {
+    static Point findTopLeftOnScreen(JComponent position) {
         // in our imaginary universe the window is always (10, 10) from the top left of the screen
         Point topLeftInWindow = findTopLeftInWindow(position);
