Source:
<code>private long savePageFor(@NonNull ReadingListPage page) throws IOException, InterruptedException { PageTitle pageTitle = ReadingListPage.toPageTitle(page); Observable<retrofit2.Response<PageLead>> leadCall = reqPageLead(CacheControl.FORCE_NETWORK, OfflineCacheInterceptor.SAVE_HEADER_SAVE, pageTitle); Observable<retrofit2.Response<PageRemaining>> sectionsCall = reqPageSections(CacheControl.FORCE_NETWORK, OfflineCacheInterceptor.SAVE_HEADER_SAVE, pageTitle); return Observable <START> .zip(leadCall, sectionsCall, (leadRsp, <END> sectionsRsp) -> { long totalSize = 0; totalSize += responseSize(leadRsp); page.downloadProgress(LEAD_SECTION_PROGRESS); WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(page)); page.downloadProgress(SECTIONS_PROGRESS); WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(page)); totalSize += responseSize(sectionsRsp); Set<String> imageUrls = new HashSet<>(pageImageUrlParser.parse(leadRsp.body())); imageUrls.addAll(pageImageUrlParser.parse(sectionsRsp.body())); if (!TextUtils.isEmpty(leadRsp.body().getThumbUrl())) { page.thumbUrl(UriUtil.resolveProtocolRelativeUrl(pageTitle.getWikiSite(), leadRsp.body().getThumbUrl())); persistPageThumbnail(pageTitle, page.thumbUrl()); imageUrls.add(page.thumbUrl()); } page.description(leadRsp.body().getDescription()); if (Prefs.isImageDownloadEnabled()) { totalSize += reqSaveImages(page, imageUrls); } String title = pageTitle.getPrefixedText(); L.i("Saved page " + title + " (" + totalSize + ")"); return totalSize; }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .blockingFirst(); }</code><technical_language>excellent</technical_language>

Target:
private long savePageFor(@NonNull ReadingListPage page) throws IOException, InterruptedException { PageTitle pageTitle = ReadingListPage.toPageTitle(page); Observable<retrofit2.Response<PageLead>> leadCall = reqPageLead(CacheControl.FORCE_NETWORK, OfflineCacheInterceptor.SAVE_HEADER_SAVE, pageTitle); Observable<retrofit2.Response<PageRemaining>> sectionsCall = reqPageSections(CacheControl.FORCE_NETWORK, OfflineCacheInterceptor.SAVE_HEADER_SAVE, pageTitle); return Observable .zip(leadCall, sectionsCall, (leadRsp, sectionsRsp) -> { long totalSize = 0; totalSize += responseSize(leadRsp); page.downloadProgress(LEAD_SECTION_PROGRESS); WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(page)); page.downloadProgress(SECTIONS_PROGRESS); WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(page)); totalSize += responseSize(sectionsRsp); Set<String> imageUrls = new HashSet<>(pageImageUrlParser.parse(leadRsp.body())); imageUrls.addAll(pageImageUrlParser.parse(sectionsRsp.body())); if (!TextUtils.isEmpty(leadRsp.body().getThumbUrl())) { page.thumbUrl(UriUtil.resolveProtocolRelativeUrl(pageTitle.getWikiSite(), leadRsp.body().getThumbUrl())); persistPageThumbnail(pageTitle, page.thumbUrl()); imageUrls.add(page.thumbUrl()); } page.description(leadRsp.body().getDescription()); if (Prefs.isImageDownloadEnabled()) { totalSize += reqSaveImages(page, imageUrls); } String title = pageTitle.getPrefixedText(); L.i("Saved page " + title + " (" + totalSize + ")"); return totalSize; }) .subscribeOn(Schedulers.io()) .blockingSingle(); }