public static String jmxSanitize(String name) {
        return MBEAN_PATTERN.matcher(name).matches() ? name : ObjectName.quote(name);
    }
@Test
    public void testJmxSanitize() throws MalformedObjectNameException {
        int unquoted = 0;
        for (int i = 0; i < 65536; i++) {
            char c = (char) i;
            String value = "value" + c;
            String jmxSanitizedValue = Sanitizer.jmxSanitize(value);
            if (jmxSanitizedValue.equals(value))
                unquoted++;
            verifyJmx(jmxSanitizedValue, i);
            String encodedValue = Sanitizer.sanitize(value);
            verifyJmx(encodedValue, i);
            // jmxSanitize should not sanitize URL-encoded values
            assertEquals(encodedValue, Sanitizer.jmxSanitize(encodedValue));
        }
        assertEquals(68, unquoted); // a-zA-Z0-9-_% space and tab
    }