FileWriter fw = new FileWriter(new File("uniprot_tgt.xml")); fw.write(FullRenderer.render(tgtIw.getItems())); fw.close();
    public void testTranslate() throws Exception {        Collection srcItems = getSrcItems();        Collection expTgtItems = getExpectedItems();        storeItems(srcItems);        if (osw.isInTransaction()) {            osw.commitTransaction();        }        ObjectStore os = (osw.getObjectStore());        ItemReader srcItemReader = new ObjectStoreItemReader(os);        // uncomment to generate a new source items file from some uniprot xml        //retrieveFromUniprotExample("test/UniprotSrc.xml", new File("generatedSrcItems.xml"));        DataTranslator translator = new UniprotDataTranslator(srcItemReader, mapping, srcModel, getTargetModel(tgtNs));        MockItemWriter tgtIw = new MockItemWriter(new LinkedHashMap());        translator.translate(tgtIw);        // print differences        Set tgtItems = tgtIw.getItems();        String diff = printCompareItemSets(new HashSet(expTgtItems), tgtItems);        if (!diff.equals("")) {            System.err.println(diff);        }        // uncomment to write out a new target items file        //FileWriter fw = new FileWriter(new File("uniprot_tgt.xml"));        //fw.write(FullRenderer.render(tgtIw.getItems()));        //fw.close();        assertEquals(new LinkedHashSet(getExpectedItems()), tgtIw.getItems());    }