private function checkPageSize($pageSize)
    {
        if (!in_array($pageSize, $this->availablePageSizes)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Invalid pageSize, "%s" given. Available pageSize are %s.',
                    $pageSize,
                    implode(', ', $this->availablePageSizes)
                )
            );
        }
    }