public function validate(FieldDefinition $fieldDefinition, SPIValue $fieldValue)
    {
        $validationErrors = array();

        if ($this->isEmptyValue($fieldValue)) {
            return $validationErrors;
        }

        $fieldSettings = $fieldDefinition->getFieldSettings();

        if ((!isset($fieldSettings['isMultiple']) || $fieldSettings['isMultiple'] === false)
            && count($fieldValue->selection) > 1) {
            $validationErrors[] = new ValidationError(
                'Field definition does not allow multiple options to be selected.',
                null,
                array(),
                'selection'
            );
        }

        foreach ($fieldValue->selection as $optionIndex) {
            if (!isset($fieldSettings['options'][$optionIndex]) && empty($fieldSettings['multilingualOptions'])) {
                $validationErrors[] = new ValidationError(
                    'Option with index %index% does not exist in the field definition.',
                    null,
                    array(
                        '%index%' => $optionIndex,
                    ),
                    'selection'
                );
            }
        }

        //@todo: find a way to include selection language
        if (isset($fieldSettings['multilingualOptions'])) {
            $possibleOptionIndexesByLanguage = array_map(function ($languageOptionIndexes) {
                return array_keys($languageOptionIndexes);
            }, $fieldSettings['multilingualOptions']);

            $possibleOptionIndexes = call_user_func_array('array_merge', $possibleOptionIndexesByLanguage);

            foreach ($fieldValue->selection as $optionIndex) {
                if (!in_array($optionIndex, $possibleOptionIndexes)) {
                    $validationErrors[] = new ValidationError(
                        'Option with index %index% does not exist in the field definition.',
                        null,
                        array(
                            '%index%' => $optionIndex,
                        ),
                        'selection'
                    );
                }
            }
        }

        return $validationErrors;
    }