ElementUtil { public static boolean isValidAttributeName(String attribute) { if (attribute == null || attribute.isEmpty()) { return false; } assert attribute.equals(attribute.toLowerCase(Locale.ENGLISH)); char[] illegalCharacters = new char[] { 0, ' ', '"', '\'', '>', '/', '=' }; for (char c : illegalCharacters) { if (attribute.indexOf(c) != -1) { return false; } } return true; } private  ElementUtil(); static boolean isValidTagName(String tag); static boolean isValidAttributeName(String attribute); static void validateStylePropertyName(String name); static boolean isValidStylePropertyName(String name); static boolean isValidStylePropertyValue(String value); static void validateStylePropertyValue(String value); static void setComponent(Element element, Component component); static Node toJsoup(Document document, Element element); static Optional<Element> fromJsoup(Node node); static boolean isCustomElement(Element element); static boolean isScript(Element element);  }
@Test public void isNullValidAttribute() { Assert.assertFalse(ElementUtil.isValidAttributeName(null)); }
@Test public void isEmptyValidAttribute() { Assert.assertFalse(ElementUtil.isValidAttributeName("")); }
@Test(expected = AssertionError.class) public void isUpperCaseValidAttribute() { ElementUtil.isValidAttributeName("FOO"); }