TypeInferenceUtils { public static BigInteger getBigInteger(String value) { BigInteger bint = null; try { bint = new BigInteger(value); } catch (NumberFormatException e) { return null; } return bint; }  static boolean isDouble(String value); static boolean isInteger(String value); static boolean isNumber(String value); static BigInteger getBigInteger(String value); static boolean isBoolean(String value); static boolean isDate(String value); static boolean isTime(String value); static boolean isEmpty(String value); static boolean isValid(DataTypeEnum type, String value); static DataTypeEnum getDataType(String value); static DataTypeEnum getNativeDataType(String value);  }
@Test public void testGetBigInteger() { String[] invalidBigIntegerValues = { "", "test", "*", "L789", "12/02/2019", " ", "456L", "2.68435E+8", "1005,123", "123.123" }; for (String value : invalidBigIntegerValues) { Assert.assertNull(TypeInferenceUtils.getBigInteger(value)); } Assert.assertEquals("1", TypeInferenceUtils.getBigInteger("001").toString()); Assert.assertEquals("123", TypeInferenceUtils.getBigInteger("123").toString()); Assert.assertEquals("0", TypeInferenceUtils.getBigInteger("0").toString()); Assert.assertEquals("-1000", TypeInferenceUtils.getBigInteger("-1000").toString()); }