public function getOriginal($entity)
    {
        $entities = $this->flatten();
        foreach ($entities as $existing) {
            if (
                $existing->getName() == $entity->getName() &&
                $existing->getGrouping() == $entity->getGrouping() &&
                $existing->getFieldname() == $entity->getFieldname() &&
                (!$existing->getBlock() || $existing->getBlock() == $entity->getBlock())
            ) {
                return $existing;
            }
        }

        return $entity;
    }