Is it possible to change TopDocCollector members to 'protected' instead of 'package' and 'private'? It will allow to easily extend it. Today, I have a need to extend it, but since I cannot use its members I have to implement the getTotalHits() and topDocs() exactly the same as TopDocCollector.

I do not see any issue with this, so if you agree, I'll open a JIRA issue and post a patch.