public static String captchaNumber(int length) {
        StringBuilder sb   = new StringBuilder();
        Random        rand = new Random();
        for (int i = 0; i < length; i++) {
            sb.append(rand.nextInt(10));
        }
        return sb.toString();
    }
@Test
    public void testCaptchaNumber() throws Exception {
        Assert.assertEquals(0, UUID.captchaNumber(0).length());
        Assert.assertEquals(2, UUID.captchaNumber(2).length());
        Assert.assertEquals(4, UUID.captchaNumber(4).length());
        Assert.assertEquals(10, UUID.captchaNumber(10).length());
        Assert.assertEquals(2, UUID.captchaChar(2).length());
        Assert.assertEquals(4, UUID.captchaChar(4).length());
        Assert.assertEquals(10, UUID.captchaChar(10).length());
    }