public int compare(final Object o1, final Object o2)
{
final CSSStyleRule r1 = (CSSStyleRule) o1;
final CSSStyleRule r2 = (CSSStyleRule) o2;
final CSSSelector selector1 = r1.getSelector();
final CSSSelector selector2 = r2.getSelector();
final SelectorWeight weight1 = selector1.getWeight();
final SelectorWeight weight2 = selector2.getWeight();
return weight1.compareTo(weight2);
}