### Question:
Position { public static double getBearingDifferenceDegrees(double bearing1, double bearing2) { if (bearing1 < 0) bearing1 += 360; if (bearing2 > 180) bearing2 -= 360; double result = bearing1 - bearing2; if (result > 180) result -= 360; return result; } Position(double lat, double lon);  Position(double lat, double lon, double alt); static Position create(double lat, double lon); static Position create(double lat, double lon, double alt); final double getLat(); final double getLon(); final double getAlt(); @Override final String toString(); final Position predict(double distanceKm, double courseDegrees); static double toDegrees(double degrees, double minutes,
			double seconds); Double getLatitudeOnGreatCircle(Position position,
			double longitudeDegrees); LongitudePair getLongitudeOnGreatCircle(Position position,
			double latitudeDegrees); final Position[] getEarthLimb(int radials); final double getDistanceToKm(Position position); final double getBearingDegrees(Position position); static double getBearingDifferenceDegrees(double bearing1,
			double bearing2); final double getDistanceKmToPath(Position p1, Position p2); static String toDegreesMinutesDecimalMinutesLatitude(double lat); static String toDegreesMinutesDecimalMinutesLongitude(double lon); static void assertWithMsg(boolean assertion, String msg); final Position getPositionAlongPath(Position position,
			double proportion); final List<Position> getPositionsAlongPath(Position position,
			double maxSegmentLengthKm); final Position to360(); final Position ensureContinuous(Position lastPosition); final boolean isWithin(List<Position> positions); @Override final boolean equals(Object o); @Override final int hashCode(); final double getDistanceToPathKm(List<Position> positions); final double getDistanceToSegmentKm(Position p1, Position p2); final Position getClosestIntersectionWithSegment(Position p1,
			Position p2); boolean isOutside(List<Position> path, double minDistanceKm); static double longitudeDiff(double a, double b); static double to180(double d); Position normalizeLongitude();  }### Answer:
@Test public final void testBearingDifference() { double precision = 0.00001; Assert.assertEquals(15.0, Position.getBearingDifferenceDegrees(20, 5), precision); Assert.assertEquals(15.0, Position.getBearingDifferenceDegrees(20, 365), precision); Assert.assertEquals(15.0, Position.getBearingDifferenceDegrees(20, 5), precision); Assert.assertEquals(15.0, Position.getBearingDifferenceDegrees(380, 5), precision); Assert.assertEquals(-25, Position.getBearingDifferenceDegrees(-20, 5), precision); Assert.assertEquals(5, Position.getBearingDifferenceDegrees(-20, -25), precision); }