public function assertResponseBodyJsonArrayLength($length) {
        $this->requireResponse();
        $length = (int) $length;

        try {
            Assertion::count(
                $body = $this->getResponseBodyArray(),
                $length,
                sprintf(
                    'Expected response body to be a JSON array with %d entr%s, got %d: "%s".',
                    $length,
                    $length === 1 ? 'y' : 'ies',
                    count($body),
                    json_encode($body, JSON_PRETTY_PRINT)
                )
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }