### Question:
FileResourceIndex implements ResourceIndex { @Override public Iterable<Resource> list(String path, String suffix) { ArrayList<Resource> list = new ArrayList<>(); new FileResourceIterator(new File(path), new File(path), suffix).forEachRemaining(list::add); return list; }  @Override Iterable<Resource> list(String path, String suffix);  }### Answer:
@Test public void listsResourcesFromFileSystemDirectory() { Iterable<Resource> jars = resourceIndex.list(PLUGINS_FIXTURE_PATH.toString(), ".jar"); assertThat(jars, contains(resourceWithPath("oneplugin/url-rewrite-1.0-SNAPSHOT.jar"))); }
@Test public void listsResourcesFromFileSystemFile() { File file = new File(PLUGINS_FIXTURE_PATH.toFile(), "groovy/UrlRewrite.groovy"); Iterable<Resource> files = resourceIndex.list(file.getPath(), ".anything"); assertThat(files, contains(resourceWithPath( PLUGINS_FIXTURE_PATH.resolve("groovy/UrlRewrite.groovy").toString()))); }