}
};
unit.addSources(Iterables.toArray(spec.getSource(), File.class));
unit.setCompilerFactory(new org.codehaus.groovy.tools.javac.JavaCompilerFactory() {
public JavaCompiler createCompiler(final CompilerConfiguration config) {
return new JavaCompiler() {
public void compile(List<String> files, CompilationUnit cu) {
spec.setSource(spec.getSource().filter(new Spec<File>() {
public boolean isSatisfiedBy(File file) {
return file.getName().endsWith(".java");
}