### Question:
CsvExporter { public void export() throws IOException { List<T> localKinoList = service.getAll(); for (T dto : localKinoList) { csvExportWriter.write(dto); } csvExportWriter.endWriting(); } CsvExporter(DataService<T> service, CsvExportWriter<T> csvExportWriter); void export();  }### Answer:
@Test public void export() throws Exception { final KinoDto aKino = mock(KinoDto.class); final KinoDto anotherKino = mock(KinoDto.class); ArrayList<KinoDto> kinos = new ArrayList<KinoDto>() {{ add(aKino); add(anotherKino); }}; doReturn(kinos).when(kinoService).getAll(); new CsvExporter(kinoService, csvExportWriter).export(); verify(csvExportWriter).write(aKino); verify(csvExportWriter).write(anotherKino); verify(csvExportWriter).endWriting(); }