Next(nextUrl, this.client.acceptLanguage(), this.client.userAgent())             .flatMap(new Func0<Response<ResponseBody>, Observable<ServiceResponse<Page<FirewallPolicyInner>>>>() {                 @Override                 public Observable<ServiceResponse<Page<FirewallPolicyInner>>> call(Response<ResponseBody> response) {                     try {                         ServiceResponse<PageImpl<FirewallPolicyInner>> result = listByResourceGroupNextDelegate(response);                         return Observable.just(new ServiceResponse<Page<FirewallPolicyInner>>(result.body(), result.response()));                     } catch (Throwable t) {                         return Observable.error(t);                     }                 }             });     }      private ServiceResponse<PageImpl<FirewallPolicyInner>> listByResourceGroupNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {         return this.client.restClient().responseBuilderFactory().<PageImpl<FirewallPolicyInner>, CloudException>newInstance(this.client.serializerAdapter())                 .register(000, new TypeToken<PageImpl<FirewallPolicyInner>>() { }.getType())                 .registerError(CloudException.class)                 .build(response);     }      /**      * Gets all the Firewall Policies in a subscription.      *      * @param nextPageLink The NextLink from the previous successful call to List operation.      * @throws IllegalArgumentException thrown if parameters fail the validation      * @throws CloudException thrown if the request is rejected by server      * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent      * @return the PagedList&lt;FirewallPolicyInner&gt; object if successful.      */     public PagedList<FirewallPolicyInner> listNext(final String nextPageLink) {         ServiceResponse<Page<FirewallPolicyInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single();         return new PagedList<FirewallPolicyInner>(response.body()) {             @Override             public Page<FirewallPolicyInner> nextPage(String nextPageLink) {                 return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();             }         };     }      /**      * Gets all the Firewall Policies in a subscription.      *      * @param nextPageLink The NextLink from the previous successful call to List operation.      * @param serviceFuture the ServiceFuture object tracking the Retrofit calls      * @param serviceCallback the async ServiceCallback to handle successful and failed responses.      * @throws IllegalArgumentException thrown if parameters fail the validation      * @return the {@link ServiceFuture} object      */     public ServiceFuture<List<FirewallPolicyInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<FirewallPolicyInner>> serviceFuture, final ListOperationCallback<FirewallPolicyInner> serviceCallback) {         return AzureServiceFuture.fromPageResponse(             listNextSinglePageAsync(nextPageLink),             new Func0<String, Observable<ServiceResponse<Page<FirewallPolicyInner>>>>() {                 @Override                 public Observable<ServiceResponse<Page<FirewallPolicyInner>>> call(String nextPageLink) {                     return listNextSinglePageAsync(nextPageLink);                 }             },             serviceCallback);     }      /**      * Gets all the Firewall Policies in a subscription.      *      * @param nextPageLink The NextLink from the previous successful call to List operation.      * @throws IllegalArgumentException thrown if parameters fail the validation      * @return the observable to the PagedList&lt;FirewallPolicyInner&gt; object      */     public Observable<Page<FirewallPolicyInner>> listNextAsync(final String nextPageLink) {         return listNextWithServiceResponseAsync(nextPageLink)             .map(new Func0<ServiceResponse<Page<FirewallPolicyInner>>, Page<FirewallPolicyInner>>() {                 @Override                 public Page<FirewallPolicyInner> call(ServiceResponse<Page<FirewallPolicyInner>> response) {                     return response.body();                 }             });     }      /**      * Gets all the Firewall Policies in a subscription.      *      * @param nextPageLink The NextLink from the previous successful call to List operation.      * @throws IllegalArgumentException thrown if parameters fail the validation      * @return the observable to the PagedList&lt;FirewallPolicyInner&gt; object      */     public Observable<ServiceResponse<Page<FirewallPolicyInner>>> listNextWithServiceResponseAsync(final String nextPageLink) {         return listNextSinglePageAsync(nextPageLink)             .concatMap(new Func0<ServiceResponse<Page<FirewallPolicyInner>>, Observable<ServiceResponse<Page<FirewallPolicyInner>>>>() {                 @Override                 public Observable<ServiceResponse<Page<FirewallPolicyInner>>> call(ServiceResponse<Page<FirewallPolicyInner>> page) {                     String nextPageLink = page.body().nextPageLink();                     if (nextPageLink == null) {                         return Observable.just(page);                     }                     return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));                 }             });     }      /**      * Gets all the Firewall Policies in a subscription.      *     ServiceResponse<PageImpl<FirewallPolicyInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.      * @throws IllegalArgumentException thrown if parameters fail the validation      * @return the PagedList&lt;FirewallPolicyInner&gt; object wrapped in {@link ServiceResponse} if successful.      */     public Observable<ServiceResponse<Page<FirewallPolicyInner>>> listNextSinglePageAsync(final String nextPageLink) {         if (nextPageLink == null) {             throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");         }         String nextUrl = String.format("%s", nextPageLink);         return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())             .flatMap(new Func0<Response<ResponseBody>, Observable<ServiceResponse<Page<FirewallPolicyInner>>>>() {                 @Override                 public Observable<ServiceResponse<Page<FirewallPolicyInner>>> call(Response<ResponseBody> response) {                     try {                         ServiceResponse<PageImpl<FirewallPolicyInner>> result = listNextDelegate(response);                         return Observable.just(new ServiceResponse<Page<FirewallPolicyInner>>(result.body(), result.response()));                     } catch (Throwable t) {                         return Observable.error(t);                     }                 }             });     }      private ServiceResponse<PageImpl<FirewallPolicyInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {         return this.client.restClient().responseBuilderFactory().<PageImpl<FirewallPolicyInner>, CloudException>newInstance(this.client.serializerAdapter())                 .register(000, new TypeToken<PageImpl<FirewallPolicyInner>>() { }.getType())                 .registerError(CloudException.class)                 .build(response);     }  