In AbstractSecondPassGroupingCollector, withinGroupSort uses a value of null to indicate a relevance sort. I think it's nicer to use Sort.RELEVANCE for this – after all it's how the groupSort variable is handled. This choice is also seen in GroupingSearch; likely some other collaborators too.
martijn.v.groningen is there some wisdom in the current choice that escapes me? If not I'll post a patch.