@Test
public void should_copy_directories() throws Exception {

    File source = folder.newFolder("source");
    Files.write("test", new File(source, "test"), Charsets.UTF_8);
    File subfolder = new File(source, "subfolder");
    subfolder.mkdirs();
    Files.write("test2", new File(subfolder, "test2"), Charsets.UTF_8);
    Path targetDir = folder.getRoot().toPath().resolve("target");
    MoreFiles.copyDir(source.toPath(), targetDir);
    assertThat(targetDir.toFile()).exists();
    assertThat(targetDir.resolve("test").toFile()).exists().hasContent("test");
    assertThat(targetDir.resolve("subfolder/test2").toFile()).exists().hasContent("test2");
}