GroovyFileSystem { public List<File> sourceFiles() { Iterable<File> files = fileSystem.files(predicates.and(isGroovyLanguage, isMainTypeFile)); List<File> list = new ArrayList<>(); files.iterator().forEachRemaining(list::add); return list; } GroovyFileSystem(FileSystem fileSystem); boolean hasGroovyFiles(); List<File> sourceFiles(); List<InputFile> groovyInputFiles(); List<InputFile> sourceInputFiles(); @CheckForNull InputFile sourceInputFileFromRelativePath(String relativePath); File baseDir();  }
@Test public void getSourceFile() { assertThat(groovyFileSystem.sourceFiles()).isEmpty(); fileSystem.add(new DefaultInputFile("", "fake.file")); assertThat(groovyFileSystem.sourceFiles()).isEmpty(); fileSystem.add(new DefaultInputFile("", "fake.groovy").setLanguage(Groovy.KEY)); assertThat(groovyFileSystem.sourceFiles()).hasSize(1); }