final FileSet testFileSet = new FileSet();
testFileSet.setProject(antProject);
testFileSet.setDir(directory);
final List/*<String>*/ includesExpanded = explodePaths(directory, includes);
testFileSet.appendIncludes((String[]) includesExpanded.toArray(new String[includesExpanded.size()]));
if (excludes != null && !excludes.isEmpty()) {
final List/*<String>*/ excludesExpanded = explodePaths(directory, excludes);
testFileSet.appendExcludes((String[]) excludesExpanded.toArray(new String[excludesExpanded.size()]));
}