### Question:
BasicProject extends BaseProject<BasicProject> { @Override public Path getDirectory() { return directory; } BasicProject(Path directory); @Override Path getDirectory();  }### Answer:
@Test public void bundle_clear() { BasicProject project = project("simple") .withContents(it -> it.copy(Paths.get("src/test/data/base-package"))); assertThat(project.getContents().find("etc/data.txt"), is(not(Optional.empty()))); project.getContents().clean(); assertThat(project.getContents().find("etc/data.txt"), is(Optional.empty())); assertThat(project.getContents().find("etc"), is(Optional.empty())); assertThat(Files.isDirectory(project.getContents().getDirectory()), is(true)); }
@Test public void bundle_clean_partial() { BasicProject project = project("simple") .withContents(it -> it.copy(Paths.get("src/test/data/base-package"))); assertThat(project.getContents().find("etc/data.txt"), is(not(Optional.empty()))); project.getContents().clean("etc/data.txt"); assertThat(project.getContents().find("etc/data.txt"), is(Optional.empty())); assertThat(project.getContents().find("etc"), is(not(Optional.empty()))); assertThat(Files.isDirectory(project.getContents().getDirectory()), is(true)); project.getContents().clean("MISSING"); }