public static Double interpolateCourse(Double c1, Double c2, double fraction) {

        if (c1 == null || c2 == null) {
            return null;
        }

        checkArgument(VALID_COURSE_RANGE.contains(c1), "The 1st course: " + c1 + " is not in range");
        checkArgument(VALID_COURSE_RANGE.contains(c2), "The 2nd course: " + c2 + " is not in range");
        checkArgument(VALID_FRACTION_RANGE.contains(fraction), "The fraction: " + fraction + " is not in range");

        double angleDelta = Spherical.angleDifference(c2, c1);
        Double course = c1 + interpolate(0.0, angleDelta, fraction);
        return Spherical.mod(course, 360.0d);
    }
@Test
    public void testInterpolateCourseOnBadInput2() {

        try {
            interpolateCourse(5.0, 10.0, -0.1);
            fail("Should not work because fraction -0.1 is out of range");
        } catch (IllegalArgumentException iae) {
            assertTrue(iae.getMessage().contains("The fraction: "));
        }
    }