### Question:
PluginMetadataImpl implements PluginMetadata { @Override public FileWriter getFileWriter( String path ) throws IOException { File resultFile = createFile( path ); return new FileWriter( resultFile ); } PluginMetadataImpl( File rootDirectory ); @Override ManifestUpdater getManifestUpdater(); @Override Document getBlueprint(); @Override void setBlueprint( Document blueprint ); @Override void writeBlueprint( String name, OutputStream outputStream ); @Override FileWriter getFileWriter( String path ); @Override OutputStream getFileOutputStream( String path ); @Override void addContentType( String contentType ); @Override List<String> getContentTypes(); @Override void executeAtEnd( Runnable runnable );  }### Answer:
@Test public void testGetFileWriter() throws Exception { File tmpDir = Files.createTempDir(); String path = "my/test/sub/directory/file.txt"; PluginMetadataImpl pluginMetadata = new PluginMetadataImpl( tmpDir ); FileWriter fileWriter = pluginMetadata.getFileWriter( path ); assertNotNull( fileWriter ); fileWriter.write( "test" ); fileWriter.flush(); fileWriter.close(); File expected = new File( tmpDir, path ); assertTrue( expected.exists() ); tmpDir.deleteOnExit(); }