XmlAnimationWriter implements AnimationWriter { @Override public void writeAnimation(String fileName, Animation animation) throws IOException { Validate.notBlank(fileName, "A filename must be provided"); Validate.notNull(animation, "An animation must be provided"); File outputFile = new File(fileName); writeAnimation(outputFile, animation); }  static AnimationFileVersion getCurrentFileVersion(); @Override void writeAnimation(String fileName, Animation animation); @Override void writeAnimation(File file, Animation animation);  }
@Test public void testWriteFileWithString() throws Exception { classToBeTested.writeAnimation(actualOutputFileName, animationToSave); File outputFile = new File(actualOutputFileName); assertTrue(outputFile.exists()); FileInputStream actualStream = new FileInputStream(outputFile); assertEquals(TestUtils.readStreamToString(expectedStream), TestUtils.readStreamToString(actualStream)); actualStream.close(); outputFile.delete(); }