### Question:
CompiledJavaccFile { public boolean customAstClassExists() { return customAstClassExists(customAstClassesDirectory); } CompiledJavaccFile(File file, File outputDirectory, FileTree customAstClassesDirectory, File targetDirectory, Logger logger); boolean customAstClassExists(); boolean customAstClassExists(FileTree fileTree); void copyCompiledFileToTargetDirectory(); void copyCustomAstClassToTargetDirectory(FileTree sourceTree); void ignoreCompiledFileAndUseCustomAstClassFromJavaSourceTree(FileTree javaSourceTree); @Override String toString();  }### Answer:
@Test public void customAstClassDoesNotExist() { File file = new File(outputDirectory, "FileWithNoCorrespondingCustomAstClass.java"); CompiledJavaccFile compiledJavaccFile = new CompiledJavaccFile(file, outputDirectory, customAstClassesDirectory, targetDirectory, logger); boolean customAstClassExists = compiledJavaccFile.customAstClassExists(); assertFalse(customAstClassExists); }
@Test public void customAstClassExists() { File file = new File(outputDirectory, "FileWithCorrespondingCustomAstClass.java"); CompiledJavaccFile compiledJavaccFile = new CompiledJavaccFile(file, outputDirectory, customAstClassesDirectory, targetDirectory, logger); boolean customAstClassExists = compiledJavaccFile.customAstClassExists(); assertTrue(customAstClassExists); }
@Test public void customAstClassDoesNotExistInSpecificDirectory() { File file = new File(outputDirectory, "FileWithNoCorrespondingCustomAstClass.java"); CompiledJavaccFile compiledJavaccFile = new CompiledJavaccFile(file, outputDirectory, customAstClassesDirectory, targetDirectory, logger); boolean customAstClassExists = compiledJavaccFile.customAstClassExists(customAstClassesDirectory); assertFalse(customAstClassExists); }
@Test public void customAstClassExistsInSpecificDirectory() { File file = new File(outputDirectory, "FileWithCorrespondingCustomAstClass.java"); CompiledJavaccFile compiledJavaccFile = new CompiledJavaccFile(file, outputDirectory, customAstClassesDirectory, targetDirectory, logger); boolean customAstClassExists = compiledJavaccFile.customAstClassExists(customAstClassesDirectory); assertTrue(customAstClassExists); }
@Test public void customAstClassCantExistInNullDirectory() { File file = new File(outputDirectory, "FileWithCorrespondingCustomAstClass.java"); CompiledJavaccFile compiledJavaccFile = new CompiledJavaccFile(file, outputDirectory, customAstClassesDirectory, targetDirectory, logger); boolean customAstClassExists = compiledJavaccFile.customAstClassExists(null); assertFalse(customAstClassExists); }