DefUtils { public static boolean isIdentifier( String id) { return id != null && identifierRegex_.matcher( id).matches(); } private  DefUtils(); static boolean isIdentifier( String id); static String[] toPath( String pathName); static void assertIdentifier( String id); static boolean isVarValue( Object val); static void assertVarValue( Object val); static void assertPath( String pathName); static void assertPropertyIdentifiers( Collection<String> properties); static String toIdentifier( String name); static String toIdentifier( Number number); static String toNumberIdentifiers( String text);  }
@Test public void isIdentifier() { assertTrue(DefUtils.isIdentifier("x")); assertTrue(DefUtils.isIdentifier("1_Bar-1")); assertTrue(DefUtils.isIdentifier("あ")); assertTrue(DefUtils.isIdentifier("Mañana_Schrödinger")); assertTrue(DefUtils.isIdentifier("123456789")); assertFalse(DefUtils.isIdentifier(null)); assertFalse(DefUtils.isIdentifier("")); assertFalse(DefUtils.isIdentifier("+")); assertFalse(DefUtils.isIdentifier("(")); assertFalse(DefUtils.isIdentifier("Mañana, Schrödinger")); assertFalse(DefUtils.isIdentifier("123456789¥")); }