@Override public int compare(Choice w1, Choice w2) {
        Object o1 = w1.o;
        Object o2 = w2.o;
        if (o1 instanceof CustomChoice) {
            if (o2 instanceof CustomChoice c2) {
                CustomChoice c1 = (CustomChoice) o1;
              int ret = c1.getPrecedence() - c2.getPrecedence();
                if (ret == 0) {
                    // in this case, the comparator is string comparator
                    ret = strComparator.compare(w1.str, w2.str);
                }

                return ret;
            }
            return -1;
        }
        if (o2 instanceof CustomChoice) {
            return 1;
        }
        int diff=0;
        if (contentComparator!=null){
        	diff = contentComparator.compare(o1, o2);
        	if (renderedContent || diff==0){
        		return diff;
        	}
        }
        int sdiff = strComparator.compare(w1.str, w2.str);
        return sdiff==0 || diff==0? sdiff : diff;
    }
@Override public int compare(Choice w1, Choice w2)