protected function checkUniqueItems($entity, $schema, $entityName)
    {
        if (isset($schema->uniqueItems) && $schema->uniqueItems) {
            if (count(array_unique($entity)) != count($entity)) {
                throw new ValidationException(sprintf('All items in array [%s] must be unique', $entityName));
            }
        }

        return $this;
    }