public static <T>void write(String fileName,Iterable<T> list,ITransformer<T,String> transformer) throws IOException {
  BufferedWriter writer=new BufferedWriter(new FileWriter(fileName));
  for (  T object : list) {
    writer.write(transformer.transform(object));
    writer.newLine();
  }
  writer.close();
}

public static < T > void write ( String fileName , Iterable < T > list , ITransformer < T , String > transformer ) throws IOException { BufferedWriter writer = new BufferedWriter ( new FileWriter ( fileName ) ) ; for ( T object : list ) { writer . write ( transformer . transform ( object ) ) ; writer . newLine ( ) ; } writer . close ( ) ; }
this function writes a list of objects into a file , one per line . each object is transformed into a string using a transformer .
