### Question:
Media { public static void saveMediaDataToFile(byte[] mediaData, String fileName) throws FileNotFoundException, IOException { saveMediaDataToFile(mediaData, new File(fileName)); } private  Media(); static byte[] getMediaDataFromFile(String fileName); static byte[] getMediaDataFromFile(File file); static byte[] getMediaDataFromUrl(String url); static byte[] getMediaDataFromUrl(URL url); static void saveMediaDataToFile(byte[] mediaData, String fileName); static void saveMediaDataToFile(byte[] mediaData, File file);  }### Answer:
@Test public void testSaveMediaDataToFile_stringArg() throws IOException { File outputFile = tempFolder.newFile(); Media.saveMediaDataToFile(TEST_DATA, outputFile.getPath()); FileInputStream inputStream = new FileInputStream(outputFile); byte[] actualBytes; try { actualBytes = ByteStreams.toByteArray(inputStream); } finally { inputStream.close(); } assertArrayEquals(TEST_DATA, actualBytes); }
@Test public void testSaveMediaDataToFile_fileArg() throws IOException { File outputFile = tempFolder.newFile(); Media.saveMediaDataToFile(TEST_DATA, outputFile); FileInputStream inputStream = new FileInputStream(outputFile); byte[] actualBytes; try { actualBytes = ByteStreams.toByteArray(inputStream); } finally { inputStream.close(); } assertArrayEquals(TEST_DATA, actualBytes); }