Code review comment: Either way, is this something that we can handle inside Tables SDK to map it to a common exception type for both Storage and Cosmos? It would be odd for users to get  `TableTransactionFailedException` and `TableServiceException` for the same transaction depending on the source service.

Code before review:
void submitTransactionAsyncWithSameRowKeys() {
String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20);
String rowKeyValue = testResourceNamer.randomName("rowKey", 20);
List<TableTransactionAction> transactionalBatch = new ArrayList<>();
transactionalBatch.add(new TableTransactionAction(
TableTransactionActionType.CREATE, new TableEntity(partitionKeyValue, rowKeyValue)));
transactionalBatch.add(new TableTransactionAction(
TableTransactionActionType.CREATE, new TableEntity(partitionKeyValue, rowKeyValue)));
if (IS_COSMOS_TEST) {
StepVerifier.create(tableClient.submitTransactionWithResponse(transactionalBatch))
.expectErrorMatches(e -> e instanceof TableServiceException
&& e.getMessage().contains("Status code 400")
&& e.getMessage().contains("InvalidDuplicateRow")
&& e.getMessage().contains("The batch request contains multiple changes with same row key.")
&& e.getMessage().contains("An entity can appear only once in a batch request."))
.verify();
} else {
StepVerifier.create(tableClient.submitTransactionWithResponse(transactionalBatch))
.expectErrorMatches(e -> e instanceof TableTransactionFailedException
&& e.getMessage().contains("An action within the operation failed")
&& e.getMessage().contains("The failed operation was")
&& e.getMessage().contains("CreateEntity")
&& e.getMessage().contains("partitionKey='" + partitionKeyValue)
&& e.getMessage().contains("rowKey='" + rowKeyValue))
.verify();
}
}

Line under review: }

Code after addressing the review:
void submitTransactionAsyncWithSameRowKeys() {
String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20);
String rowKeyValue = testResourceNamer.randomName("rowKey", 20);
List<TableTransactionAction> transactionalBatch = new ArrayList<>();
transactionalBatch.add(new TableTransactionAction(
TableTransactionActionType.CREATE, new TableEntity(partitionKeyValue, rowKeyValue)));
transactionalBatch.add(new TableTransactionAction(
TableTransactionActionType.CREATE, new TableEntity(partitionKeyValue, rowKeyValue)));
if (IS_COSMOS_TEST) {
StepVerifier.create(tableClient.submitTransactionWithResponse(transactionalBatch))
.expectErrorMatches(e -> e instanceof TableServiceException
&& e.getMessage().contains("Status code 400")
&& e.getMessage().contains("InvalidDuplicateRow")
&& e.getMessage().contains("The batch request contains multiple changes with same row key.")
&& e.getMessage().contains("An entity can appear only once in a batch request."))
.verify();
} else {
StepVerifier.create(tableClient.submitTransactionWithResponse(transactionalBatch))
.expectErrorMatches(e -> e instanceof TableTransactionFailedException
&& e.getMessage().contains("An action within the operation failed")
&& e.getMessage().contains("The failed operation was")
&& e.getMessage().contains("CreateEntity")
&& e.getMessage().contains("partitionKey='" + partitionKeyValue)
&& e.getMessage().contains("rowKey='" + rowKeyValue))
.verify();
}
}