source: class MainActivityPresenterTest {
  
      private MainActivityPresenter presenter;
      @Mock
      private MainActivityView view;
      @Mock
      private ITopAlbumsService topAlbumsService;
  
      @Test
      public void whenRequestAlbumsCalledAndNetworkCallFails() {
  
target: 
          //given
          ArgumentCaptor<ITopAlbumsService.Callback> callbackArgumentCaptor = ArgumentCaptor.forClass(ITopAlbumsService.Callback.class);
  
          //when
          presenter.requestAlbumsClicked();
  
          //then
          Mockito.verify(view).showProgressDialog();
          Mockito.verify(topAlbumsService).requestAlbums(callbackArgumentCaptor.capture());
  
          callbackArgumentCaptor.getValue().failure();
  
          Mockito.verify(view).hideProgressDialog();
          Mockito.verify(view).showErrorMessage();
      }
  
  }