### Question:
Uml2XsdWriter { public static final void writeSchema(final List<PsmDocument<Type>> elements, final ModelIndex model, final Uml2XsdPlugin plugin, final File file) { try { final OutputStream outstream = new BufferedOutputStream(new FileOutputStream(file)); try { writeSchema(elements, model, plugin, outstream); } finally { closeQuiet(outstream); } } catch (final FileNotFoundException e) { LOG.warn(e.getMessage()); } } Uml2XsdWriter(); static final void writeSchema(final List<PsmDocument<Type>> elements, final ModelIndex model,
            final Uml2XsdPlugin plugin, final File file); static final void writeSchema(final List<PsmDocument<Type>> documents, final ModelIndex model,
            final Uml2XsdPlugin plugin, final OutputStream outstream); static final void writeSchema(final List<PsmDocument<Type>> elements, final ModelIndex model,
            final Uml2XsdPlugin plugin, final String fileName);  }### Answer:
@Test public void testByFile() throws FileNotFoundException { File file = new File(filename); Uml2XsdWriter.writeSchema(documents, model, plugin, file); try { XsdReader.readSchema(file, null); } catch (AssertionError e) { Assert.fail(); } finally { file.delete(); } }
@Test public void testByString() throws FileNotFoundException { Uml2XsdWriter.writeSchema(documents, model, plugin, filename); try { XsdReader.readSchema(filename, null); } catch (AssertionError e) { Assert.fail(); } finally { File file = new File(filename); file.delete(); } }