I have a HashMap that I would like to write as separate lines to a text file. How do you go about doing this? In the SysOut above the code for writing to a text file I am printing out the values in the way that I would like to print them.
    map.forEach((k,v)-> System.out.println(k+", "+v));
    File file = new File(Constants.FILEPATH);
    FileOutputStream f = new FileOutputStream(file);  
    ObjectOutputStream s = new ObjectOutputStream(f);          
    s.writeObject(map);
    s.close();
 
    