question: private int assertPivotCountsAreCorrect ( String pivotName , SolrParams baseParams , PivotField constraint ) throws SolrServerException { SolrParams p = SolrParams . wrapAppended ( baseParams , params ( "fq" , buildFilter ( constraint ) ) ) ; List < PivotField > subPivots = null ; try { assertPivotData ( pivotName , constraint , p ) ; subPivots = constraint . getPivot ( ) ; } catch ( Exception e ) { throw new RuntimeException ( pivotName + ": count query failed: " + p + ": " + e . getMessage ( ) , e ) ; } int depth = 0 ; if ( null != subPivots ) { assertTraceOk ( pivotName , baseParams , subPivots ) ; for ( PivotField subPivot : subPivots ) { depth = assertPivotCountsAreCorrect ( pivotName , p , subPivot ) ; } } return depth + 1 ; }
target:  Recursive Helper method for asserting that pivot constraint counts match results when filtering on those constraints. Returns the recursive depth reached  (for sanity checking)