Calculate the intersection of the nested ResourceCollections.
List rcs = getResourceCollections();
int size = rcs.size();
if (size < 2) {
throw new BuildException("The intersection of " + size
+ " resource collection" + ((size == 1) ? "" : "s")
+ " is undefined.");
}
ArrayList al = new ArrayList();
Iterator rc = rcs.iterator();
al.addAll(collect(rc.next()));
while (rc.hasNext()) {
al.retainAll(collect(rc.next()));
}
return al;