code: public static List<BitextRule> selectBitextRules(List<BitextRule> bRules, List<String> disabledRules, List<String> enabledRules, boolean useEnabledOnly) {
      List<BitextRule> newBRules = new ArrayList<>(bRules.size());
      newBRules.addAll(bRules);
      List<BitextRule> rulesToDisable = new ArrayList<>();
      if (useEnabledOnly) {
        for (String enabledRule : enabledRules) {
          for (BitextRule b : bRules) {
            if (!b.getId().equals(enabledRule)) {
              rulesToDisable.add(b);
            }
          }
        }
      } else {
        for (String disabledRule : disabledRules) {
          for (BitextRule b : newBRules) {
            if (b.getId().equals(disabledRule)) {
              rulesToDisable.add(b);
            }
          }
        }
      }
      newBRules.removeAll(rulesToDisable);
      return newBRules;
    }
docs: Enable and disable bitext rules.
  @param bRules List of all bitext rules
  @param disabledRules ids of rules to be disabled
  @param enabledRules ids of rules to be enabled (by default all are enabled)
  @param useEnabledOnly if set to {@code true}, if set to {@code true}, disable all rules except those enabled explicitly.
  @return the list of rules to be used.
  @since 2.8