PasteUtils { public static Integer toInt(String input) { if (input == null) { return null; } input = input.replace(",", "").replaceAll("\\.", ""); return StringUtils.isEmpty(input) ? null : Integer.parseInt(input); } private  PasteUtils(); static String[] split(Object input); static Integer toInt(String input); static String translateSeparators(String input, Locale locale); static String stripSeparators(String input);  }
@Test public void testToInt() { assertEquals(1234, PasteUtils.toInt("1234")); assertEquals(1234, PasteUtils.toInt("1,234")); assertEquals(1234, PasteUtils.toInt("1.234")); }