### Question:
AngleCalc { public double alignOrientation(double baseOrientation, double orientation) { double resultOrientation; if (baseOrientation >= 0) { if (orientation < -Math.PI + baseOrientation) resultOrientation = orientation + 2 * Math.PI; else resultOrientation = orientation; } else if (orientation > +Math.PI + baseOrientation) resultOrientation = orientation - 2 * Math.PI; else resultOrientation = orientation; return resultOrientation; }  double calcOrientation(double lat1, double lon1, double lat2, double lon2); double calcOrientation(double lat1, double lon1, double lat2, double lon2, boolean exact); double convertAzimuth2xaxisAngle(double azimuth); double alignOrientation(double baseOrientation, double orientation); double calcAzimuth(double lat1, double lon1, double lat2, double lon2);  }### Answer:
@Test public void testAlignOrientation() { assertEquals(90.0, Math.toDegrees(AC.alignOrientation(Math.toRadians(90), Math.toRadians(90))), 0.001); assertEquals(225.0, Math.toDegrees(AC.alignOrientation(Math.toRadians(90), Math.toRadians(-135))), 0.001); assertEquals(-45.0, Math.toDegrees(AC.alignOrientation(Math.toRadians(-135), Math.toRadians(-45))), 0.001); assertEquals(-270.0, Math.toDegrees(AC.alignOrientation(Math.toRadians(-135), Math.toRadians(90))), 0.001); }