Index: trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 10224)
+++ trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 10225)
@@ -9,6 +9,4 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -32,4 +30,5 @@
 import org.openstreetmap.josm.tools.Geometry;
 import org.openstreetmap.josm.tools.RightAndLefthandTraffic;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -58,14 +57,8 @@
     public void addSelected(OsmPrimitive p, DataSet ds) {
         try {
-            final Method method = ds.getClass()
+            Method method = ds.getClass()
                 .getDeclaredMethod("addSelected",
                                    new Class<?>[] {Collection.class, boolean.class});
-            AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                @Override
-                public Object run() {
-                    method.setAccessible(true);
-                    return null;
-                }
-            });
+            Utils.setObjectsAccessible(method);
             method.invoke(ds, Collections.singleton(p), false);
         } catch (ReflectiveOperationException e) {
@@ -165,10 +158,8 @@
             Field leftHandTrafficPolygons = RightAndLefthandTraffic.class
                 .getDeclaredField("leftHandTrafficPolygons");
-            leftHandTrafficPolygons.setAccessible(true);
+            Field rlCache = RightAndLefthandTraffic.class.getDeclaredField("rlCache");
+            Utils.setObjectsAccessible(leftHandTrafficPolygons, rlCache);
             leftHandTrafficPolygons.set(null, new ArrayList<Area>());
-            Field rlCache = RightAndLefthandTraffic.class.getDeclaredField("rlCache");
-            rlCache.setAccessible(true);
-            ConstantTrafficHand trafficHand = new ConstantTrafficHand(true);
-            rlCache.set(null, new GeoPropertyIndex<>(trafficHand, 24));
+            rlCache.set(null, new GeoPropertyIndex<>(new ConstantTrafficHand(true), 24));
         } catch (ReflectiveOperationException e) {
             e.printStackTrace();
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 10224)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 10225)
@@ -26,4 +26,5 @@
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -54,5 +55,5 @@
 
         Field mapView = MapFrame.class.getDeclaredField("mapView");
-        mapView.setAccessible(true);
+        Utils.setObjectsAccessible(mapView);
         mapView.set(Main.map, new MapViewMock(dataSet, layer));
 
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java	(revision 10224)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java	(revision 10225)
@@ -10,6 +10,4 @@
 import java.awt.event.MouseEvent;
 import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Arrays;
 import java.util.Collection;
@@ -26,4 +24,5 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.tools.Utils;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -54,12 +53,6 @@
             super(mapFrame);
             try {
-                final Field mv = SelectAction.class.getDeclaredField("mv");
-                AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                    @Override
-                    public Object run() {
-                        mv.setAccessible(true);
-                        return null;
-                    }
-                });
+                Field mv = SelectAction.class.getDeclaredField("mv");
+                Utils.setObjectsAccessible(mv);
                 mv.set(this, new MapViewMock(dataSet, layer));
             } catch (ReflectiveOperationException e) {
Index: trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java	(revision 10224)
+++ trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java	(revision 10225)
@@ -16,4 +16,5 @@
 import org.junit.Test;
 import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.tools.Utils;
 import org.reflections.Reflections;
 
@@ -99,5 +100,5 @@
             throw new RuntimeException(ex);
         }
-        c.setAccessible(true);
+        Utils.setObjectsAccessible(c);
         T o;
         try {
