### Question:
FileManager { public File copy(File objectFile, File destDir) throws ApplicationException { CopyOperation co = new CopyOperation(objectFile, destDir, false); co.apply(); return co.getDestination(); } FileManager();  FileManager(Application app); void synchronize(File source, File target); void rename(File fileToRename, File target); void move(File object, File newParent); void move(File object, File newParent, FileFilter filter); void delete(File object); void delete(File object, FileFilter filter); void deleteChildren(File parentDir); void deleteRecursively(File file); void deleteRecursively(File file, FileFilter filter,
                                DeletionPolicy deletePolicy); File copy(File objectFile, File destDir); File copy(File objectFile, File destDir, boolean overwrite); void copyRecursively(File objectFile, File destDir); void copyRecursively(File objectFile, File destDir, FileFilter filter); void copyRecursively(File objectFile, File destDir,
                              FileFilter filter, boolean overwrite); boolean filesDiffer(File f1, File f2);  }### Answer:
@Test(enabled = false) public void testCopy() throws Exception { File file = new File(fmWorkspace, "file"); writeContents(file, "abc"); File dir = new File(fmWorkspace, "dir"); String[] children = dir.list(); assertTrue(children == null || children.length == 0); fileManager.copy(file, dir); assertTrue(file.exists()); assertEquals(dir.list().length, 1); }
@Test(enabled = false, expectedExceptions = ApplicationException.class) public void testCopy1() throws Exception { File file = new File(fmWorkspace, "file"); writeContents(file, "abc"); File file2 = new File(fmWorkspace, "file2"); writeContents(file2, "abc"); fileManager.copy(file, file2); }
@Test(enabled = false) public void testCopy2() throws Exception { File file = new File(fmWorkspace, "file"); String NEW_CHILD_CONTENT = "new"; writeContents(file, NEW_CHILD_CONTENT); File dir = new File(fmWorkspace, "dir"); dir.mkdir(); File dirChild = new File(dir, "file"); String ORIGINAL_CHILD_CONTENT = "orinld"; writeContents(dirChild, ORIGINAL_CHILD_CONTENT); fileManager.copy(file, dir, false); assertEquals(contentsOf(dirChild), ORIGINAL_CHILD_CONTENT); fileManager.copy(file, dir, true); assertEquals(contentsOf(dirChild), NEW_CHILD_CONTENT); }