TypeInferenceUtils { public static boolean isInteger(String value) { if (!isEmpty(value) && patternInteger.matcher(value).matches()) { return true; } return false; }  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 testIsInteger() throws Exception { List<String> values = loadData("testInteger.csv"); int countOfIntegers = 0; long timeStart = System.currentTimeMillis(); Assert.assertEquals(10000, values.size()); for (String value : values) { if (TypeInferenceUtils.isInteger(value)) { countOfIntegers++; } } long timeEnd = System.currentTimeMillis(); Assert.assertEquals(3000, countOfIntegers); long difference = timeEnd - timeStart; LOGGER.debug("The method isInteger spent " + difference + " ms on 10000 values."); }