### Question:
ShellCommandUtil { public static Result copyFile(String srcFile, String destFile, boolean force, boolean sudo) throws IOException, InterruptedException { ArrayList<String> command = new ArrayList<>(); if (WINDOWS) { command.add("copy"); if (force) { command.add("/Y"); } } else { command.add("cp"); command.add("-p"); if (force) { command.add("-f"); } } command.add(srcFile); command.add(destFile); return runCommand(command, null, null, sudo); }  static void logOpenSslExitCode(String command, int exitCode); static String hideOpenSslPassword(String command); static String getOpenSslCommandResult(String command, int exitCode); static String getUnixFilePermissions(String path); static void setUnixFilePermissions(String mode, String path); static Result setFileOwner(String path, String ownerName); static Result setFileGroup(String path,  String groupName); static Result setFileMode(String path,
                                   boolean ownerReadable, boolean ownerWritable, boolean ownerExecutable,
                                   boolean groupReadable, boolean groupWritable, boolean groupExecutable,
                                   boolean otherReadable, boolean otherWritable, boolean otherExecutable); static Result pathExists(String path, boolean sudo); static Result mkdir(String directoryPath, boolean sudo); static Result copyFile(String srcFile, String destFile, boolean force, boolean sudo); static Result delete(String file, boolean force, boolean sudo); static Result runCommand(List<String> args, Map<String, String> vars, InteractiveHandler interactiveHandler, boolean sudo); static Result runCommand(String[] args, Map<String, String> vars, InteractiveHandler interactiveHandler, boolean sudo); static Result runCommand(String[] args, Map<String, String> vars); static Result runCommand(String[] args); static final boolean WINDOWS; static final boolean LINUX; static final boolean MAC; static final boolean UNIX_LIKE; static final String MASK_OWNER_ONLY_RW; static final String MASK_OWNER_ONLY_RWX; static final String MASK_EVERYBODY_RWX; }### Answer:
@Test public void testCopy() throws Exception { File srcFile = temp.newFile(); File destFile = new File(srcFile.getParentFile(), "copied_file"); FileWriter writer = new FileWriter(srcFile); writer.write("Hello World!!!!!"); writer.close(); ShellCommandUtil.Result result = ShellCommandUtil.copyFile(srcFile.getAbsolutePath(), destFile.getAbsolutePath(), false, false); Assert.assertTrue(result.isSuccessful()); Assert.assertTrue(destFile.exists()); Assert.assertTrue(destFile.length() > 0); Assert.assertEquals(destFile.length(), srcFile.length()); }