protected function checkUnsupportedTypes(array $objects)
    {
        if ($this->supportedTypes !== null) {
            $unsupportedTypes = array_diff(TypedUtils::uniqueTypes($objects), $this->supportedTypes);
            if (count($unsupportedTypes) > 0) {
                throw new Exception(sprintf(
                    'Encountered unsupported types %s (supported: %s)',
                    implode(', ', $unsupportedTypes),
                    count($this->supportedTypes) > 0 ? implode(', ', $this->supportedTypes) : '*none*'
                ));
            }
        }
    }