package ru.stqa.pft.addressbook.generators;


import ru.stqa.pft.addressbook.model.GroupData;

import java.awt.*;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class GroupDataGenerator {

   public static void main(String[] args){
      int count = Integer.parseInt(args[0]);
      File file = new File(args[1]);

      List<GroupData> groups = generateGroups(count);
      save(groups, file);
   }

   private static List<GroupData> generateGroups(int count){
      List<GroupData> groups = new ArrayList<GroupData>();
      for (int i = 0; i < count; i++) {
         groups.add(new GroupData().withName(String.format("test %s", i))
         .withHeader(String.format("header %s", i))
         .withFooter(String.format("footer %s", i)));
      }
      return groups;
   }
}

@@ -128,16 +128,94 @@
 o.File;%0A
+import java.io.FileWriter;%0Aimport java.io.IOException;%0Aimport java.io.Writer;%0A
 import j
@@ -334,16 +334,36 @@
 %5B%5D args)
+ throws IOException 
 %7B%0A      
@@ -525,16 +525,325 @@
 ;%0A   %7D%0A%0A
+   private static void save(List%3CGroupData%3E groups, File file) throws IOException %7B%0A      Writer writer = new FileWriter(file);%0A      for(GroupData group : groups) %7B%0A         writer.write(String.format(%22%25s;%25s;%25s%5Cn%22, group.getName(), group.getHeader(), group.getFooter()));%0A      %7D%0A      writer.close();%0A   %7D%0A%0A
    priva

fix test ho