@Test
public void itShouldValidateToFloat() {

    Float float1 = new Float(2421.123);
    Integer integer1 = new Integer(12);
    Long long1 = new Long(324L);
    Double double1 = new Double(12.2345);
    BigDecimal bigDecimal1 = new BigDecimal(1231.2).setScale(2, BigDecimal.ROUND_DOWN);
    Assert.assertEquals(float1, NumericFunctions.toFloat("2421.123"));
    Assert.assertEquals(new Float(integer1), NumericFunctions.toFloat(integer1));
    Assert.assertEquals(new Float(long1), NumericFunctions.toFloat(long1));
    Assert.assertEquals(new Float(double1), NumericFunctions.toFloat(double1));
    Assert.assertEquals(new Float(bigDecimal1.floatValue()), NumericFunctions.toFloat(bigDecimal1));
}