Code review comment: I know we said Java might diverge on this (doing file for sync, url for async), but I think that because you've added a recognizeReceipts and a recognizeReceipts FromURL, you can have the other sync and async functions call the files functions

Code before review:
public static void main(final String[] args)  {
FormRecognizerAsyncClient client = new FormRecognizerClientBuilder()
.apiKey(new AzureKeyCredential("{api_key}"))
.endpoint("https:
.buildAsyncClient();
PollerFlux<OperationResult, IterableStream<FormPage>> recognizeLayoutPoller =
client.beginRecognizeContentFromUrl("file_source_url");
Mono<IterableStream<FormPage>> layoutPageResults = recognizeLayoutPoller
.last()
.flatMap(trainingOperationResponse -> {
if (trainingOperationResponse.getStatus().isComplete()) {
return trainingOperationResponse.getFinalResult();
} else {
return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:"
+ trainingOperationResponse.getStatus()));
}
});
layoutPageResults.subscribe(formPages -> formPages.forEach(formPage -> {
System.out.println("----Recognizing content ----");
System.out.printf("Has width: %s and height: %s, measured with unit: %s%n", formPage.getWidth(),
formPage.getHeight(),
formPage.getUnit());
formPage.getTables().forEach(formTable -> {
System.out.printf("Table has %s rows and %s columns.%n", formTable.getRowCount(),
formTable.getColumnCount());
formTable.getCells().forEach(formTableCell -> {
final StringBuilder boundingBoxStr = new StringBuilder();
if (formTableCell.getBoundingBox() != null) {
formTableCell.getBoundingBox().getPoints().forEach(point ->
boundingBoxStr.append(String.format("[%s, %s]", point.getX(), point.getY())));
}
System.out.printf("Cell has text %s, within bounding box %s.%n", formTableCell.getText(),
boundingBoxStr);
});
System.out.println();
});
}));
try {
TimeUnit.MINUTES.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}

Line under review: client.beginRecognizeContentFromUrl("file_source_url");

Code after addressing the review:
public static void main(final String[] args)  {
FormRecognizerAsyncClient client = new FormRecognizerClientBuilder()
.apiKey(new AzureKeyCredential("{api_key}"))
.endpoint("https:
.buildAsyncClient();
PollerFlux<OperationResult, IterableStream<FormPage>> recognizeLayoutPoller =
client.beginRecognizeContentFromUrl("https:
Mono<IterableStream<FormPage>> layoutPageResults = recognizeLayoutPoller
.last()
.flatMap(trainingOperationResponse -> {
if (trainingOperationResponse.getStatus().isComplete()) {
return trainingOperationResponse.getFinalResult();
} else {
return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:"
+ trainingOperationResponse.getStatus()));
}
});
layoutPageResults.subscribe(formPages -> formPages.forEach(formPage -> {
System.out.println("----Recognizing content ----");
System.out.printf("Has width: %s and height: %s, measured with unit: %s%n", formPage.getWidth(),
formPage.getHeight(),
formPage.getUnit());
formPage.getTables().forEach(formTable -> {
System.out.printf("Table has %s rows and %s columns.%n", formTable.getRowCount(),
formTable.getColumnCount());
formTable.getCells().forEach(formTableCell -> {
final StringBuilder boundingBoxStr = new StringBuilder();
if (formTableCell.getBoundingBox() != null) {
formTableCell.getBoundingBox().getPoints().forEach(point ->
boundingBoxStr.append(String.format("[%.2f, %.2f]", point.getX(), point.getY())));
}
System.out.printf("Cell has text %s, within bounding box %s.%n", formTableCell.getText(),
boundingBoxStr);
});
System.out.println();
});
}));
try {
TimeUnit.MINUTES.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}