### Question:
LineageWriter implements ILineageWriter { @Override public void outputLineageGraph( LineageHolder holder ) throws IOException { if ( graphWriter != null ) { MetaverseUtil.delay(); graphWriter.outputGraph( holder.getMetaverseBuilder().getGraph(), getGraphOutputStream() ); MetaverseUtil.delay(); } else { throw new IOException( "No graph output stream associated with this LineageWriter" ); } }  @Override void outputExecutionProfile( LineageHolder holder ); @Override void outputLineageGraph( LineageHolder holder ); OutputStream getProfileOutputStream(); OutputStream getGraphOutputStream(); void setProfileOutputStream( OutputStream profileOutputStream ); void setGraphOutputStream( OutputStream graphOutputStream ); IGraphWriter getGraphWriter(); void setGraphWriter( IGraphWriter graphWriter ); @Override String getOutputStrategy(); @Override void setOutputStrategy( String strategy ); @Override void cleanOutput( LineageHolder holder );  }### Answer:
@Test public void testOutputLineageGraph() throws Exception { Graph g = new TinkerGraph(); IMetaverseBuilder builder = new MetaverseBuilder( g ); holder.setMetaverseBuilder( builder ); writer.setGraphOutputStream( System.out ); IGraphWriter graphWriter = mock( IGraphWriter.class ); writer.setGraphWriter( graphWriter ); writer.outputLineageGraph( holder ); }
@Test( expected = IOException.class ) public void testOutputLineageGraphNoOutputStream() throws Exception { Graph g = new TinkerGraph(); IMetaverseBuilder builder = new MetaverseBuilder( g ); holder.setMetaverseBuilder( builder ); writer.outputLineageGraph( holder ); }