public void save(String fileName) throws IOException {
  try (BufferedWriter w=new BufferedWriter(new FileWriter(fileName),1000000)){
    for (    String key : keySet()) {
      Integer value=get(key);
      if (value != null)       w.write(key + "\t" + value+ "\n");
    }
  }
 }

public void save ( String fileName ) throws IOException { try ( BufferedWriter w = new BufferedWriter ( new FileWriter ( fileName ) , 1000000 ) ) { for ( String key : keySet ( ) ) { Integer value = get ( key ) ; if ( value != null ) w . write ( key + "\t" + value + "\n" ) ; } } }
save to a file
