public function matches(\Neos\ContentRepository\Domain\Model\NodeData $node)
    {
        $nodeIsMatchingNodeType = false;

        for($i=0; $i<$this->searchDepth;$i++){
            $parentNode = $node->getParent();

            if($parentNode!==null){
                // This will break atm for NodeTypes that no longer exist - see /Packages/Application/Neos.ContentRepository/Classes/TYPO3/TYPO3CR/Migration/Filters/NodeType.php
                // version stated there is a "hack" though and does not allow for standard UnitTesting
                $nodeType = $parentNode->getNodeType();

                if ($this->withSubTypes === true) {
                    $nodeIsMatchingNodeType = $nodeType->isOfType($this->nodeTypeName);
                } else {
                    if ($nodeType->getName() === $this->nodeTypeName) {
                        $nodeIsMatchingNodeType = true;
                        break;
                    }
                }
                $node = $parentNode;
            }
            else{
                break;
            }
        }

        return $nodeIsMatchingNodeType;
    }