### Question:
DirBasedSteward implements Steward { @Override public Path getDaemonJar(Path jumiHome) { Path extractedJar = jumiHome.resolve("lib/" + daemonJar.getDaemonJarName()); createIfDoesNotExist(extractedJar); return extractedJar; } DirBasedSteward(DaemonJar daemonJar); @Override Path createDaemonDir(Path jumiHome); @Override Path getDaemonJar(Path jumiHome);  }### Answer:
@Test public void copies_the_embedded_daemon_JAR_to_the_settings_dir() throws IOException { Path daemonJar = steward.getDaemonJar(jumiHome); assertThat(daemonJar.getFileName().toString(), is(expectedName)); assertThat(FileUtils.readFileToByteArray(daemonJar.toFile()), is(expectedContent)); }
@Test public void does_not_copy_the_daemon_JAR_if_it_has_already_been_copied() throws IOException { FileTime lastModified1 = Files.getLastModifiedTime(steward.getDaemonJar(jumiHome)); FileTime lastModified2 = Files.getLastModifiedTime(steward.getDaemonJar(jumiHome)); assertThat(lastModified2, is(lastModified1)); }
@Test public void overwrites_an_existing_daemon_JAR_that_has_difference_file_size() throws IOException { overwriteWithFileOfSize(expectedContent.length + 1, steward.getDaemonJar(jumiHome)); Path daemonJar = steward.getDaemonJar(jumiHome); assertThat(FileUtils.readFileToByteArray(daemonJar.toFile()), is(expectedContent)); }