private static void saveMap(Map toSave) {
        try {
            try (ObjectOutputStream ostr = new ObjectOutputStream(new FileOutputStream(decisiontrees.DecisionTreesBuilderSettings.TREES_DIRECTORY+ "/"+decisiontrees.DecisionTreesBuilderSettings.INDEX_FILE))) {
                ostr.writeObject(toSave);
                ostr.close();
            }
        } catch (IOException ex) {
            Logger.getLogger(BuildTrees.class.getName()).log(Level.ERROR, null, ex);
        }
    }