@Test
public void testCasting() {

    double nan = Double.NaN;
    assertTrue(Float.isNaN(Double2Float.safeCasting(nan)));
    double maxQ = Double.MAX_VALUE;
    assertEquals(Float.MAX_VALUE, Double2Float.safeCasting(maxQ), 1e-6);
    double minQ = -Double.MAX_VALUE;
    assertEquals(-Float.MAX_VALUE, Double2Float.safeCasting(minQ), 1e-6);
    Double n = null;
    assertNull(Double2Float.safeCasting(n));
}