PossibleMatch[] result = new PossibleMatch[this.elementCount];
int index = 0;
for (int i = 0, length = roots.length; i < length; i++) {
ObjectVector possibleMatches = (ObjectVector) this.rootsToPossibleMatches.get(roots[i].getPath());
if (possibleMatches != null) {
possibleMatches.copyInto(result, index);
index += possibleMatches.size();
}
}
if (index < this.elementCount)
System.arraycopy(result, 0, result = new PossibleMatch[index], 0, index);