@Override
  public int compareTo(@NotNull StdArrangementMatchRule o) {
    final Map<ArrangementSettingsToken, Object> tokenValues = ArrangementUtil.extractTokens(getMatcher().getCondition());
    final Map<ArrangementSettingsToken, Object> tokenValues1 = ArrangementUtil.extractTokens(o.getMatcher().getCondition());
    final Set<ArrangementSettingsToken> tokens = tokenValues.keySet();
    final Set<ArrangementSettingsToken> tokens1 = tokenValues1.keySet();
    if (tokens1.containsAll(tokens)) {
      return tokens.containsAll(tokens1) ? 0 : 1;
    }
    else {
      if (tokens.containsAll(tokens1)) {
        return -1;
      }

      final String entryType = getEntryType(tokenValues);
      final String entryType1 = getEntryType(tokenValues1);
      final int compare = StringUtil.compare(entryType1, entryType, false);
      if (compare != 0 || tokens.size() == tokens1.size()) {
        return compare;
      }
      return tokens.size() < tokens1.size() ? 1 : -1;
    }
  }
@Override
  public int compareTo(@NotNull StdArrangementMatchRule o)