### Question:
FileUtils { public static void writeByteArrayToFile(File file, byte[] data) throws IOException { writeByteArrayToFile(file, data, false); }  static void writeByteArrayToFile(File file, byte[] data); static void writeByteArrayToFile(File file, byte[] data, boolean append); static FileOutputStream openOutputStream(File file, boolean append); static void saveCommandHistory(List<int[]> history, File file); static List<int[]> loadCommandHistory(File file); static void saveCommandHistoryString(List<String> history, File file); static List<String> loadCommandHistoryString(File file); static String readFileToString(File file, Charset encoding); static Properties readProperties(String file);  }### Answer:
@Test public void testWriteByteArrayToFile() throws IOException { String data = "test data"; File targetFile = temporaryFolder.newFile("targetFile.txt"); FileUtils.writeByteArrayToFile(targetFile, data.getBytes()); TestUtils.assertEqualContent(data.getBytes(), targetFile); }
@Test public void testWriteByteArrayToFileWithAppend() throws IOException { String data = "test data"; File targetFile = temporaryFolder.newFile("targetFile.txt"); FileUtils.writeByteArrayToFile(targetFile, data.getBytes(), true); TestUtils.assertEqualContent(data.getBytes(), targetFile); }