public static Integer stringToInteger(String in) {
        if (in == null) {
            return null;
        }
        in = in.trim();
        if (in.length() == 0) {
            return null;
        }

        try {
            return Integer.parseInt(in);
        } catch (NumberFormatException e) {
            LOG.warn("stringToInteger fail,string=" + in, e);
            return null;
        }
    }
@Test
    public void testStringToInteger() {
        Assert.assertNull(StringUtils.stringToInteger(""));
        Assert.assertNull(StringUtils.stringToInteger(null));
        Assert.assertNull(StringUtils.stringToInteger("a"));

        Assert.assertEquals(new Integer(3), StringUtils.stringToInteger("3"));
    }