protected function setValue(
        EntityInterface $entity,
        AttributeInterface $attribute,
        $default_value,
        array $options = array()
    ) {
        $attribute_name = $attribute->getName();
        $attribute_options = array();

        if (!empty($options[self::OPTION_FIELD_VALUES])
            && is_array($options[self::OPTION_FIELD_VALUES])
        ) {
            $attribute_options = $options[self::OPTION_FIELD_VALUES];
        }

        if (empty($attribute_options[$attribute_name])) {
            $entity->setValue($attribute_name, $default_value);
        } else {
            $option = $attribute_options[$attribute_name];
            if (is_callable($option)) {
                $entity->setValue($attribute_name, call_user_func($option));
            } else {
                $entity->setValue($attribute_name, $option);
            }
        }
    }