### Question:
FileSystemLineageWriter 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() ); File destFolder = getOutputDirectoryAsFile( holder ); String name = Const.NVL( profile.getName(), "unknown" ); File file = new File( destFolder, timestampString + "_" + name + extension ); try { return new FileOutputStream( file ); } catch ( FileNotFoundException e ) { log.error( "Couldn't find file: " + file.getAbsolutePath(), e ); return null; } } catch ( Exception e ) { log.error( "Couldn't get output stream", e ); return null; } } else { return null; } } FileSystemLineageWriter(); @Override void outputExecutionProfile( LineageHolder holder ); @Override void outputLineageGraph( LineageHolder holder ); IGraphWriter getGraphWriter(); void setGraphWriter( IGraphWriter graphWriter ); String getOutputFolder(); 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() { assertNull( writer.createOutputStream( null, null ) ); assertNotNull( writer.createOutputStream( holder, "ktr" ) ); new File(BAD_OUTPUT_FOLDER).delete(); writer.setOutputFolder( BAD_OUTPUT_FOLDER ); assertNotNull( writer.createOutputStream( holder, null ) ); assertNotNull( writer.createOutputStream( holder, "ktr" ) ); }