public function cloneInstance(core_kernel_classes_Resource $instance, core_kernel_classes_Class $clazz = null)
    {
        if (is_null($clazz)) {
            $types = $instance->getTypes();
            $clazz = current($types);
        }

        $returnValue = $this->createInstance($clazz);
        if (!is_null($returnValue)) {
            $properties = $clazz->getProperties(true);
            foreach ($properties as $property) {
                $this->cloneInstanceProperty($instance, $returnValue, $property);
            }
            $label = $instance->getLabel();
            $cloneLabel = "$label bis";
            if (preg_match("/bis(\s[0-9]+)?$/", $label)) {
                $cloneNumber = (int)preg_replace("/^(.?)*bis/", "", $label);
                $cloneNumber++;
                $cloneLabel = preg_replace("/bis(\s[0-9]+)?$/", "", $label)."bis $cloneNumber" ;
            }

            $returnValue->setLabel($cloneLabel);
        }

        return $returnValue;
    }