Hmmm... thinking about it, why cannot you just loop over the feature collections, call size(), and accumulate? The code you wrote also works only for the single collection case, which is not the general one (a GetFeature can ask for muliple feature types)