ValidCharacters { public static boolean hasInvalidCharacters(String str) { return hasInvalidCharactersTable(CHARS_ALLOWED, str); } private  ValidCharacters(); static boolean hasInvalidCharacters(String str); static String toValidCharset(String str); static Metric toValidValue(Metric metric); static List<Metric> toValidValues(List<Metric> metrics); static void tagToJson(JsonGenerator gen, Tag tag);  }
@Test public void testValidStr() throws Exception { String valid = "AZabc09.-_"; assertFalse(ValidCharacters.hasInvalidCharacters(valid)); }
@Test public void testInvalidStr() throws Exception { String caret = "abc09.-_^abc"; assertTrue(ValidCharacters.hasInvalidCharacters(caret)); String tilde = "abc09.-_~abc"; assertTrue(ValidCharacters.hasInvalidCharacters(tilde)); String str = "abc09.-_ abc"; assertTrue(ValidCharacters.hasInvalidCharacters(str)); String boundaries = "\u0000\u0128\uffff"; assertTrue(ValidCharacters.hasInvalidCharacters(boundaries)); }