File file1 = new File("f1");
File file2 = new File("f2");
File file3 = new File("dir/f1");
TestFileCollection collection = new TestFileCollection(file1, file2);
FileCollection filtered = collection.filter(HelperUtil.toClosure("{f -> f.name == 'f1'}"));
assertThat(filtered.getFiles(), equalTo(toSet(file1)));
collection.files.add(file3);
assertThat(filtered.getFiles(), equalTo(toSet(file1, file3)));
}