### Question:
BlueprintsGraphMetaverseReader implements IMetaverseReader { @Override public String exportFormat( String format ) { OutputStream out = new ByteArrayOutputStream(); try { exportToStream( format, out ); } catch ( IOException e ) { LOGGER.error( Messages.getString( "ERROR.Graph.Export" ), e ); } finally { try { out.close(); } catch ( IOException e ) { LOGGER.error( Messages.getString( "ERROR.Graph.Export" ), e ); } } return out.toString(); } BlueprintsGraphMetaverseReader( Graph graph ); @Override IMetaverseNode findNode( String id ); @Override List<IMetaverseNode> findNodes( String property, String value ); @Override IMetaverseLink findLink( String leftNodeID, String linkType, String rightNodeID, Direction direction ); @Override Graph getMetaverse(); @Override String exportToXml(); @Override String exportFormat( String format ); void exportToStream( String format, OutputStream out ); @Override Graph search( List<String> resultTypes, List<String> startNodeIDs, boolean shortestOnly ); @Override Graph getGraph( String id );  }### Answer:
@Test public void testExportJson() throws Exception { BlueprintsGraphMetaverseReader metaverseReader = new BlueprintsGraphMetaverseReader( graph ); String export = metaverseReader.exportFormat( IMetaverseReader.FORMAT_JSON ); assertNotNull( "Export is null", export ); assertTrue( "Export content is wrong", export.indexOf( "{" ) == 0 ); assertTrue( "Export content is wrong", export.indexOf( "data.txt" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( "IP Addr" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( "City" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( "Sales" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( "trans1.ktr" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( DictionaryConst.COLOR_DOCUMENT ) != -1 ); }
@Test public void testExportCsv() throws Exception { BlueprintsGraphMetaverseReader metaverseReader = new BlueprintsGraphMetaverseReader( graph ); String export = metaverseReader.exportFormat( IMetaverseReader.FORMAT_CSV ); assertNotNull( "Export is null", export ); assertTrue( "Export content is wrong", export.indexOf( "\"SourceId\",\"SourceVirtual\"" ) == 0 ); assertTrue( "Export content is wrong", export.indexOf( "data.txt" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( "IP Addr" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( "City" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( "Sales" ) != -1 ); assertTrue( "Export content is wrong", export.indexOf( "trans1.ktr" ) != -1 ); }