public function validateByParent($nodeType, NodeInterface $parent = null)
    {
        if (!$nodeType) {
            return true;
        }

        $config = $this->getNodeTypeConfig($nodeType);
        if (null === $config) {
            return false;
        }

        if ((null !== $parent) && $parent->getType()) {
            return in_array($parent->getType(), $config->getParentTypes());
        }

        return false;
    }