Add tests for private categorical stats helper functions