### Question:
TextFileOutput extends BaseTransform<Meta, Data> implements ITransform<Meta, Data> { protected boolean closeFile( String filename ) { try { data.getFileStreamsCollection().closeFile( filename ); } catch ( Exception e ) { logError( "Exception trying to close file: " + e.toString() ); setErrors( 1 ); return false; } return true; } TextFileOutput( TransformMeta transformMeta, Meta meta, Data data, int copyNr, PipelineMeta pipelineMeta,
                         Pipeline pipeline ); boolean isFileExists( String filename ); void initFileStreamWriter( String filename ); String getOutputFileName( Object[] row ); int getFlushInterval(); int getMaxOpenFiles(); boolean isWriteHeader( String filename ); void flushOpenFiles( boolean closeAfterFlush ); synchronized boolean processRow(); void writeRow( IRowMeta rowMeta, Object[] r ); String buildFilename( String filename, boolean ziparchive ); @Override boolean init(); @Override void dispose(); boolean containsSeparatorOrEnclosure( byte[] source, byte[] separator, byte[] enclosure );  }### Answer:
@Test public void testCloseFileDataOutIsNullCase() { textFileOutput = new TextFileOutput( transformMockHelper.transformMeta, transformMockHelper.iTransformMeta, Mockito.mock( TextFileOutputData.class ), 0, transformMockHelper.pipelineMeta, transformMockHelper.pipeline ); Assert.assertNull( textFileOutput.getData().out ); textFileOutput.closeFile(); }
@Test public void testCloseFileDataOutIsNotNullCase() { textFileOutput = new TextFileOutput( transformMockHelper.transformMeta, transformMockHelper.iTransformMeta, Mockito.mock( TextFileOutputData.class ), 0, transformMockHelper.pipelineMeta, transformMockHelper.pipeline ); textFileOutput.getData().out = Mockito.mock( CompressionOutputStream.class ); textFileOutput.closeFile(); Assert.assertNull( textFileOutput.getData().out ); }