Question: I have start to learning how to test properly on controller and encounter this following script.

<http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html>

```
it('should have a properly working VideosCtrl controller', inject(function($rootScope, $controller, $httpBackend) {
    var searchTestAtr = 'cars';
    var response = $httpBackend.expectJSONP(
      'https://gdata.youtube.com/feeds/api/videos?q=' + searchTestAtr + '&v=2&alt=json&callback=JSON_CALLBACK');
    response.respond(null);

    var $scope = $rootScope.$new();
    var ctrl = $controller('VideosCtrl', {
      $scope : $scope,
      $routeParams : {
        q : searchTestAtr
      }
    });
  }));

```

I am a bit confused... expectedJSON is in the following API page:

<https://docs.angularjs.org/api/ngMock/service/$httpBackend>

I am confused Just wondering what's testing in here, i can see the describe there but still lost... what's expected here?

Answer: 
Without changing the outer loop, you only need to change the inner loop to :

```
for (int c = BASE_SIZE; c > r; c--)

```

So :

```
    for (int r = 0; r < BASE_SIZE; r++)
    {
        for (int c = BASE_SIZE; c > r; c--)
        {
            System.out.print("*");
        }
        System.out.println();
    }

```
```
for(int c = r ; c > 0 ; c--)
    System.out.print("*");

```