### Question:
VfsLineageWriter implements ILineageWriter { protected OutputStream createOutputStream( LineageHolder holder, String extension ) { if ( holder != null ) { try { IExecutionProfile profile = holder.getExecutionProfile(); String timestampString = Long.toString( profile.getExecutionData().getStartTime().getTime() ); FileObject destFolder = getOutputDirectoryAsFile( holder ); String name = cleanseName( Const.NVL( profile.getName(), "unknown" ) ); FileObject file = destFolder.resolveFile( timestampString + "_" + name + extension ); FileContent content = file.getContent(); return content.getOutputStream(); } catch ( Exception e ) { log.error( Messages.getErrorString( "ERROR.CantCreateOutputStream" ), e ); return null; } } else { return null; } } VfsLineageWriter(); @Override void outputExecutionProfile( LineageHolder holder ); @Override void outputLineageGraph( LineageHolder holder ); IGraphWriter getGraphWriter(); void setGraphWriter( IGraphWriter graphWriter ); String getOutputFolder(); static boolean isVFSPrefix( String prefix ); void setOutputFolder( String outputFolder ); @Override String getOutputStrategy(); @Override void setOutputStrategy( String strategy ); @Override void cleanOutput( LineageHolder holder ); static final String DEFAULT_OUTPUT_FOLDER; }### Answer:
@Test public void testCreateOutputStream() throws IOException { try ( OutputStream nullOS = writer.createOutputStream( null, null ); OutputStream ktrOS = writer.createOutputStream( holder, "ktr" ) ) { assertNull( nullOS ); assertNotNull( ktrOS ); } writer.setOutputFolder( BAD_OUTPUT_FOLDER ); try ( OutputStream nullOS = writer.createOutputStream( holder, null ); OutputStream ktrOS = writer.createOutputStream( holder, "ktr" ) ) { assertNotNull( nullOS ); assertNotNull( ktrOS ); } }