public static int parseInt(String num, int defaultInt) {
        if (num == null) {
            return defaultInt;
        } else {
            try {
                return Integer.parseInt(num);
            } catch (Exception e) {
                return defaultInt;
            }
        }
    }
@Test
    public void testParseInt() {
        Assert.assertEquals(CommonUtils.parseInt("", 123), 123);
        Assert.assertEquals(CommonUtils.parseInt("xxx", 123), 123);
        Assert.assertEquals(CommonUtils.parseInt(null, 123), 123);
        Assert.assertEquals(CommonUtils.parseInt("12345", 123), 12345);
    }