protected function isNestedCriteria(array $criterionData): bool
    {
        $isValid = true;

        foreach ($criterionData as $key => $possibleCriterion) {
            $isValid = $isValid &&
                (
                    (is_int($key) && is_array($possibleCriterion)) ||
                    ($key === Criterion::BOOLEAN && in_array($possibleCriterion, ['and', 'or']))
                );
        }

        return $isValid;
    }