public function extract(array $json)
    {
        if (!$this->hasData($json)) {
            return null;
        }
        if (!$this->isCollection($json)) {
            return $this->extractOne($json, $json['data']);
        } else {
            $data = $this->extractMultiple($json);
            if ($this->isPaginated($json)) {
                return (new PaginatedEntitySet($data))
                    ->setPerPage($json['meta']['pagination']['per_page'])
                    ->setCurrentPage($json['meta']['pagination']['current_page'])
                    ->setTotal($json['meta']['pagination']['total']);
            }
            return new EntitySet($data);
        }
    }