private static void saveContactsToCsvFile(List<ContactData> contacts, File file)
     throws IOException {
   FileWriter writer = new FileWriter(file);
   for (ContactData contact : contacts) {
     writer.write(
         contact.getFirstname()
             + ","
             + contact.getLastname()
             + ","
             + contact.getAddress()
             + ","
             + contact.getHometelephone()
             + ","
             + contact.getMobile()
             + ","
             + contact.getWorktelephone()
             + ","
             + contact.getEmail1()
             + ","
             + contact.getEmail2()
             + ","
             + contact.getSecondaryaddress()
             + ","
             + contact.getPhone2()
             + ","
             + contact.getBday()
             + ","
             + contact.getByear()
             + ","
             + contact.getBmonth()
             + ",!"
             + "\n");
   }
   writer.close();
 }