public function testJSONResponseWithExistingResponse()
 {
     $request = $this->getRequest(true, 'json');
     $response = new Response();
     $response->headers->set('X-Custom', 'value');
     $statsTable = new StatsTable(array(array('what' => 'else ?')));
     $event = $this->getGetResponseForControllerResultEvent($request, $statsTable, $response);
     $this->listener->onKernelView($event);
     $response = $event->getResponse();
     $this->assertNotNull($response);
     $this->assertContains('application/json', $response->headers->get('content-type'));
     $this->assertEquals('value', $response->headers->get('X-Custom'));
 }