public void flush() throws IOException {
        FileWriter fw = new FileWriter(fileName);
        Iterator iter = mergeText().iterator();

        while (iter.hasNext() == true) {
            fw.write((String) iter.next() + "\n");
        }

        fw.flush();
        fw.close();
    }