### Question:
DtoImportCreator { List<Dto> getKinos(FileReader fileReader) throws ImportException { Iterable<CSVRecord> csvRecords; try { csvRecords = csvFormatWrapper.parse(fileReader); } catch (IOException e) { throw new ImportException(context.getString(R.string.import_parsing_error_toast), e); } List<Dto> kinos = new ArrayList<>(); for (CSVRecord csvRecord : csvRecords) { kinos.add(dtoFromRecordBuilder.build(csvRecord)); } return kinos; } DtoImportCreator(Context context, DtoFromRecordBuilder<Dto> builder);   DtoImportCreator(CSVFormatWrapper csvFormatWrapper, DtoFromRecordBuilder<Dto> dtoFromRecordBuilder, Context context);   }### Answer:
@Test public void getKinos() throws Exception { doReturn(new ArrayList<CSVRecord>() {{ add(record); }}).when(csvFormatWrapper).parse(fileReader); doReturn(kinoDto).when(kinoDtoFromRecordBuilder).build(record); assertEquals( Collections.singletonList(kinoDto), new DtoImportCreator(csvFormatWrapper, kinoDtoFromRecordBuilder, context).getKinos(fileReader) ); }
@Test(expected = ImportException.class) public void getKinos_ioException_onWrapper() throws Exception { doThrow(new IOException()).when(csvFormatWrapper).parse(fileReader); assertEquals( Collections.singletonList(kinoDto), new DtoImportCreator(csvFormatWrapper, kinoDtoFromRecordBuilder, context).getKinos(fileReader) ); }