@Test
public void test() {

    // 1 m/s
    double speed = SpeedConverter.toKnots(1, "m/s");
    assertEquals(1.94384449, speed, 1E-6);
    // -1 m/s
    speed = SpeedConverter.toKnots(-1, "m/s");
    assertEquals(-1.94384449, speed, 1E-6);
    // 100 cm/s
    speed = SpeedConverter.toKnots(100, "cm/s");
    assertEquals(1.94384449, speed, 1E-6);
    // 10 cm/s
    speed = SpeedConverter.toKnots(10, "cm/s");
    assertEquals(.194384449, speed, 1E-6);
    // knot to knot
    speed = SpeedConverter.toKnots(10, "kn");
    assertEquals(10, speed, 1E-6);
    // knot to knot
    speed = SpeedConverter.toKnots(10, "kts");
    assertEquals(10, speed, 1E-6);
    // mph
    speed = SpeedConverter.toKnots(1, "mph");
    assertEquals(0.868976242, speed, 1E-6);
    // km/h
    speed = SpeedConverter.toKnots(1, "km/h");
    assertEquals(0.539956803, speed, 1E-6);
    // NaN
    speed = SpeedConverter.toKnots(Double.NaN, "km/h");
    assertEquals(Double.NaN, speed, 1E-6);
    // infinite
    try {
        speed = SpeedConverter.toKnots(Double.NEGATIVE_INFINITY, "km/h");
        assertTrue(false);
    } catch (IllegalArgumentException e) {
        // ok
    }
    try {
        speed = SpeedConverter.toKnots(Double.POSITIVE_INFINITY, "km/h");
        assertTrue(false);
    } catch (IllegalArgumentException e) {
        // ok
    }
    // feet/s
    speed = SpeedConverter.toKnots(1, NonSI.FOOT.toString() + "/s");
    assertEquals(0.592483801, speed, 1E-6);
    try {
        speed = SpeedConverter.toKnots(1, "a/s");
        assertTrue(false);
    } catch (IllegalArgumentException e) {
        // ok
    }
}