There's a size>0 check which seems to be redundant and some DelegatingCollector.finish calls seem to be missing.