PrintWriter blah = new PrintWriter(new FileWriter("foo.xml")); descriptor.writeXML(blah, 0); blah.flush();
    public void testSave() throws Exception {        URL url = getClass().getResource("/samples/saved.xml");        Document inputDocument = documentBuilder.parse(url.toString());        WorkflowDescriptor descriptor = DescriptorLoader.getDescriptor(url.toString());        StringWriter out = new StringWriter();        PrintWriter writer = new PrintWriter(out);        writer.println(WorkflowDescriptor.XML_HEADER);        writer.println(WorkflowDescriptor.DOCTYPE_DECL);        descriptor.writeXML(new PrintWriter(out), 0);        PrintWriter blah = new PrintWriter(new FileWriter("foo.xml"));        descriptor.writeXML(blah, 0);        blah.flush();        Document outputDocument = getDocument(out.toString());        Diff diff = new Diff(inputDocument, outputDocument);        diff.overrideElementQualifier(new ElementNameAndTextQualifier());        assertTrue(diff.toString(), diff.similar());        assertXMLEqual("But they are equal when an ElementQualifier controls which test element is compared with each control element", diff, true);        assertTrue(diff.toString(), diff.similar());    }