Assert { public static void isNmtoken(String token, String paramName) { if (!XMLChar.isValidNmtoken(token)) { String msg = MessageFormat .format( "Parameter ''{0}'' with value ''{1}'' is not a valid NMTOKEN", paramName, token); throw new IllegalArgumentException(msg); } } private  Assert(); static void notNull(Object param, String paramName); static void validXMLChars(String s, String paramName); static void isNmtoken(String token, String paramName); static void xliffAttrAvailable(Element elem, String... attrNames); static void xliffAttrRestricted(Element elem,
			boolean nonXliffAllowed, boolean xmlSpaceAllowed,
			boolean xmlLangAllowed, String... xliffAttrNames); static void isXliffElement(org.w3c.dom.Node node); static void isXliffElement(org.w3c.dom.Node node, String name); static void isElement(Node node); static void isNonXliffElement(org.w3c.dom.Node node); static void isInstance(Object object, String name,
			Class<?>... classes); static void areInstances(Collection<?> objects, String name,
			Class<?>... classes);  }
@Test public void testIsNmtoken() { try { Assert.isNmtoken("$", "test"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } Assert.isNmtoken("abc", "test"); }