public static String maskHalfString(String str) {
        if (str == null) {
            return null;
        } else {
            // not null
            int halfLength = str.length() / 2;
            String masked = "*".repeat(halfLength) + str.substring(halfLength);
            return masked;
        }
    }
@Test
    public void testMaskHalfString() {
        String s = "1234567890";
        Assert.assertEquals("*****67890", StringUtils.maskHalfString(s));
        s = "123456789";
        Assert.assertEquals("****56789", StringUtils.maskHalfString(s));
    }