VCSActivity vcsActivity = (VCSActivity) (vcsActivities.get(i));
if (!result.contains(vcsActivity))
continue;
// Iterate in reverse order so that we can safely remove items.
for (int j = result.size() - 1; j > i; j--) {
IResourceActivity otherActivity = result.get(j);
if (result.contains(otherActivity)
&& vcsActivity.includes(otherActivity)) {
if (!(otherActivity instanceof VCSActivity)) {
vcsActivity.containedActivity.add(0, otherActivity);
}