@Test
public void testParseOnNumberFormat() throws ClassNotFoundException {

  final Object[][] testParameters = new Object[][] {
      {"127", Byte.class, NumberFormat.getInstance(), (byte) 127},
      {"1,280", Short.class, NumberFormat.getInstance(), (short) 1280},
      {"25,500", Integer.class, NumberFormat.getInstance(), 25500},
      {"256,000", Long.class, NumberFormat.getInstance(), 256000L},
      {"5,110,000", BigInteger.class, new DecimalFormat(), BigInteger.valueOf(5110000)},
      {"51,200,000", BigInteger.class, new DecimalFormat(),
          new BigDecimal("51200000").toBigInteger()},
      {"10,230,000.1023", Float.class, new DecimalFormat(), 10230000.1023f},
      {"10,240,000.1024", Double.class, new DecimalFormat(), 10240000.1024d}, {"204,700,000.2047",
          BigDecimal.class, new DecimalFormat(), new BigDecimal("204700000.2047")}};
  assertNotNull(NumberUtils.parse("127", Byte.class, null));
  for (final Object[] testParameter : testParameters) {
    Object expected = Class.forName(testParameter[3].getClass().getName()).cast(testParameter[3]);
    String text = (String) testParameter[0];
    Class<?> targetClass = (Class<?>) testParameter[1];
    NumberFormat numberFormat = (NumberFormat) testParameter[2];
    assertEquals(expected, NumberUtils.parse(text, targetClass, numberFormat));
  }
}