/** * Checks whether only the given attributes are present on the element. * * @param names * the attributes to check * @return true iff only the given attributes are present, false otherwise */ public boolean onlyAttributesPresent(String... names) { if (names == null) { return false; } return element.getAttributes().size() == names.length && allAttributesPresent(names); }