Source:
<code>PollerFlux<TextAnalyticsOperationResult, PagedIterable<AnalyzeTasksResult>> beginAnalyzeTasksIterable( Iterable<TextDocumentInput> documents, AnalyzeTasksOptions options, Context context) { try { inputDocumentsValidation(documents); AnalyzeBatchInput analyzeBatchInput = new AnalyzeBatchInput() .setAnalysisInput(new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents))); <START> Duration pollingInterval = DEFAULT_POLL_INTERVAL; if (options != null) { analyzeBatchInput.setTasks(getJobManifestTasks(options)).setDisplayName(options.getDisplayName()); pollingInterval = options.getPollInterval(); } final Boolean finalIncludeStatistics = options == null ? null : options.isIncludeStatistics(); final Integer finalTop = options == null ? null : options.getTop(); final Integer finalSkip = options == null ? null : options.getSkip(); <END> return new PollerFlux<>( pollingInterval, activationOperation( service.analyzeWithResponseAsync(analyzeBatchInput, context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .map(analyzeResponse -> { final TextAnalyticsOperationResult textAnalyticsOperationResult = new TextAnalyticsOperationResult(); TextAnalyticsOperationResultPropertiesHelper.setResultId(textAnalyticsOperationResult, parseModelId(analyzeResponse.getDeserializedHeaders().getOperationLocation())); return textAnalyticsOperationResult; })), pollingOperation(resultID -> service.analyzeStatusWithResponseAsync(resultID, options == null ? null : options.isIncludeStatistics(), null, null, context)), (activationResponse, pollingContext) -> Mono.error(new RuntimeException("Cancellation is not supported.")), fetchingOperationIterable(resultId -> Mono.just(new PagedIterable<>(getAnalyzeOperationFluxPage( resultId, finalTop, finalSkip, finalIncludeStatistics, context)))) ); } catch (RuntimeException ex) { return PollerFlux.error(ex); } }</code><technical_language>this put a function avoid repeated code</technical_language>

Target:
PollerFlux<TextAnalyticsOperationResult, PagedIterable<AnalyzeTasksResult>> beginAnalyzeTasksIterable( Iterable<TextDocumentInput> documents, AnalyzeTasksOptions options, Context context) { try { inputDocumentsValidation(documents); if (options == null) { options = new AnalyzeTasksOptions(); } final AnalyzeBatchInput analyzeBatchInput = new AnalyzeBatchInput() .setAnalysisInput(new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents))) .setTasks(getJobManifestTasks(options)); analyzeBatchInput.setDisplayName(options.getDisplayName()); final boolean finalIncludeStatistics = options.isIncludeStatistics(); final Integer finalTop = options.getTop(); final Integer finalSkip = options.getSkip(); return new PollerFlux<>( options.getPollInterval(), activationOperation( service.analyzeWithResponseAsync(analyzeBatchInput, context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .map(analyzeResponse -> { final TextAnalyticsOperationResult textAnalyticsOperationResult = new TextAnalyticsOperationResult(); TextAnalyticsOperationResultPropertiesHelper.setResultId(textAnalyticsOperationResult, parseModelId(analyzeResponse.getDeserializedHeaders().getOperationLocation())); return textAnalyticsOperationResult; })), pollingOperation(resultID -> service.analyzeStatusWithResponseAsync(resultID, finalIncludeStatistics, finalTop, finalSkip, context)), (activationResponse, pollingContext) -> Mono.error(new RuntimeException("Cancellation is not supported.")), fetchingOperationIterable(resultId -> Mono.just(new PagedIterable<>(getAnalyzeOperationFluxPage( resultId, finalTop, finalSkip, finalIncludeStatistics, context)))) ); } catch (RuntimeException ex) { return PollerFlux.error(ex); } }