public void saveToFile(File rulesFile, DependencyRuleSet dontDuplicate) {
        try {
            PrintWriter out = new PrintWriter(new FileWriter(rulesFile));
            out.println(description);

            for (DependencyRule rule: getRules()) {
                if ((dontDuplicate == null || !dontDuplicate.getRules().contains(rule))
                        // Don't save implicit rules
                        && !TO_DEBIAN_VERSION_RULE.equals(rule)
                        && !MAVEN_PLUGINS_KEEP_VERSION_RULE.equals(rule)) {
                    out.println(rule.toString());
                }
            }
            out.flush();
            out.close();
        } catch (IOException ex) {
            log.log(Level.SEVERE, null, ex);
        }
    }