code: public static void writeMapFile (BufferedWriter bout, HashMap<String, Integer> map)
          throws IOException
      {
          String[] lines = new String[map.size()];
          Iterator<String> iter = map.keySet().iterator();
          for (int ii = 0; iter.hasNext(); ii++) {
              String key = iter.next();
              Integer value = map.get(key);
              lines[ii] = key + SEP_STR + value;
          }
          QuickSort.sort(lines);
          for (String line : lines) {
              bout.write(line, 0, line.length());
              bout.newLine();
          }
          bout.flush();
      }
docs: Writes out a mapping from strings to integers in a manner that can
  be read back in via {@link #readMapFile}.