code: private static Set<Attr> collectAttributes(Element element, boolean includeCssClass) {
  		Set<Attr> attributes = new HashSet<Attr>();
  		Attr cssClass = null;
  		boolean foundDataCssClass = false;
  
  		for (Attr attr : element.getAttrs()) {
  			final AttrImpl attrImpl = new AttrImpl(attr);
  			if (includeCssClass) {
  				attributes.add(attrImpl);
  				continue;
  			}
  
  			// logic for variant with CSS class exclusion
  			if (!"class".equalsIgnoreCase(attr.getName())) {
  				attributes.add(attrImpl);
  			} else {
  				cssClass = attrImpl;
  			}
  			if ("data-css-class".equalsIgnoreCase(attr.getName())) {
  				foundDataCssClass = true;
  			}
  		}
  
  		if (!foundDataCssClass && cssClass != null) {
  			// takes care to preserve static CSS class if CSS_CLASS operator is not present
  			attributes.add(cssClass);
  		}
  		return attributes;
  	}
docs: Collect all element attributes less CSS class. This method collect all attributes from given <code>element</code> but
  skip the <code>class</code> attribute to allows for operator handling. Anyway, if CSS_CLASS operator is missing static
  CSS class is still included in order to preserve element class.
  
  @param element element to scan for attributes.
  @return non CSS class element attributes.