Index: trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java	(revision 18661)
+++ trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/FunctionsTest.java	(revision 18664)
@@ -3,4 +3,5 @@
 
 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;
@@ -8,31 +9,27 @@
 
 import java.util.Collections;
+import java.util.Objects;
 
-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;
+import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.User;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.preferences.NamedColorProperty;
 import org.openstreetmap.josm.gui.mappaint.Environment;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests of {@link Functions}.
  */
+@BasicPreferences
+@Projection
 class FunctionsTest {
-
-    /**
-     * Setup rule
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules();
-
     private static class EnvBuilder {
         private final OsmPrimitive osm;
@@ -108,4 +105,25 @@
 
     /**
+     * Test for {@link Functions#parent_way_angle(Environment)}
+     */
+    @Test
+    void testParentWayAngle() {
+        assertNull(Functions.parent_way_angle(new EnvBuilder(NODE).build()));
+        final Environment environment = new EnvBuilder(NODE).build();
+        ((Node) environment.osm).setCoor(LatLon.ZERO);
+        final Way parent = TestUtils.newWay("", new Node(new LatLon(-.1, 0)), (Node) environment.osm, new Node(new LatLon(.1, 0)));
+        environment.parent = parent;
+        Double actual = Functions.parent_way_angle(environment);
+        assertNotNull(actual);
+        assertEquals(Math.toRadians(0), actual, 1e-9);
+        // Reverse node order
+        Objects.requireNonNull(parent.firstNode()).setCoor(LatLon.NORTH_POLE);
+        Objects.requireNonNull(parent.lastNode()).setCoor(LatLon.SOUTH_POLE);
+        actual = Functions.parent_way_angle(environment);
+        assertNotNull(actual);
+        assertEquals(Math.toRadians(180), actual, 1e-9);
+    }
+
+    /**
      * Unit test of {@code Functions#to_xxx}
      */
@@ -163,4 +181,3 @@
         Config.getPref().put(colorKey, null);
     }
-
 }
