Merge "Update tests/cts/AndroidManifestShowMigrationInfoIntentAbsent.xml" into main
diff --git a/OWNERS b/OWNERS
index 7fa769e..78ed4e5 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,4 +1,4 @@
-# Bug component: 1388912
+# Bug component: 1219472
 
 jstembridge@google.com
 arkivanov@google.com
diff --git a/apex/Android.bp b/apex/Android.bp
index 47c5c27..1fd496d 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -42,6 +42,7 @@
     updatable: true,
     bootclasspath_fragments: ["com.android.healthfitness-bootclasspath-fragment"],
     systemserverclasspath_fragments: ["com.android.healthfitness-systemserverclasspath-fragment"],
+    visibility: ["//packages/modules/common/build"],
 }
 
 sdk {
diff --git a/tests/cts/AndroidManifestRateLimiter.xml b/tests/cts/AndroidManifestRateLimiter.xml
index 0ba91ed..934f5b0 100644
--- a/tests/cts/AndroidManifestRateLimiter.xml
+++ b/tests/cts/AndroidManifestRateLimiter.xml
@@ -36,8 +36,6 @@
     <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
                      android:label="CTS HealthConnect tests"
                      android:targetPackage="android.healthconnect.cts.ratelimiter">
-        <meta-data android:name="listener"
-                   android:value="com.android.cts.runner.CtsTestRunListener"/>
     </instrumentation>
 
     <uses-permission android:name="android.permission.health.READ_HEART_RATE"/>
diff --git a/tests/cts/AndroidManifestUI.xml b/tests/cts/AndroidManifestUI.xml
index 44eb971..e0e7455 100644
--- a/tests/cts/AndroidManifestUI.xml
+++ b/tests/cts/AndroidManifestUI.xml
@@ -28,8 +28,6 @@
     <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
         android:label="CTS HealthConnect UI tests"
         android:targetPackage="android.healthconnect.cts.ui">
-        <meta-data android:name="listener"
-            android:value="com.android.cts.runner.CtsTestRunListener"/>
     </instrumentation>
 
     <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
diff --git a/tests/cts/src/android/healthconnect/cts/ActiveCaloriesBurnedRecordTest.java b/tests/cts/src/android/healthconnect/cts/ActiveCaloriesBurnedRecordTest.java
index eecd084..cf93ad7 100644
--- a/tests/cts/src/android/healthconnect/cts/ActiveCaloriesBurnedRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/ActiveCaloriesBurnedRecordTest.java
@@ -153,8 +153,9 @@
                         new ReadRecordsRequestUsingFilters.Builder<>(
                                         ActiveCaloriesBurnedRecord.class)
                                 .build());
-        ActiveCaloriesBurnedRecord testRecord = getCompleteActiveCaloriesBurnedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        ActiveCaloriesBurnedRecord testRecord =
+                (ActiveCaloriesBurnedRecord)
+                        TestUtils.insertRecord(getCompleteActiveCaloriesBurnedRecord());
         List<ActiveCaloriesBurnedRecord> newActiveCaloriesBurnedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -177,8 +178,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        ActiveCaloriesBurnedRecord testRecord = getCompleteActiveCaloriesBurnedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        ActiveCaloriesBurnedRecord testRecord =
+                (ActiveCaloriesBurnedRecord)
+                        TestUtils.insertRecord(getCompleteActiveCaloriesBurnedRecord());
         List<ActiveCaloriesBurnedRecord> newActiveCaloriesBurnedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -206,8 +209,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        ActiveCaloriesBurnedRecord testRecord = getCompleteActiveCaloriesBurnedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        ActiveCaloriesBurnedRecord testRecord =
+                (ActiveCaloriesBurnedRecord)
+                        TestUtils.insertRecord(getCompleteActiveCaloriesBurnedRecord());
         List<ActiveCaloriesBurnedRecord> newActiveCaloriesBurnedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -269,9 +273,9 @@
                 List.of(
                         getBaseActiveCaloriesBurnedRecord(),
                         getCompleteActiveCaloriesBurnedRecord());
-        TestUtils.insertRecords(records);
+        List<Record> insertedRecords = TestUtils.insertRecords(records);
 
-        for (Record record : records) {
+        for (Record record : insertedRecords) {
             TestUtils.verifyDeleteRecords(
                     new DeleteUsingFiltersRequest.Builder()
                             .addRecordType(record.getClass())
@@ -309,12 +313,12 @@
     @Test
     public void testDeleteActiveCaloriesBurnedRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(
-                        getBaseActiveCaloriesBurnedRecord(),
-                        getCompleteActiveCaloriesBurnedRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseActiveCaloriesBurnedRecord(),
+                                getCompleteActiveCaloriesBurnedRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -545,8 +549,8 @@
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
         List<Record> testRecord =
-                Collections.singletonList(getCompleteActiveCaloriesBurnedRecord());
-        TestUtils.insertRecords(testRecord);
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteActiveCaloriesBurnedRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/BasalBodyTemperatureRecordTest.java b/tests/cts/src/android/healthconnect/cts/BasalBodyTemperatureRecordTest.java
index 2aefe73..a485021 100644
--- a/tests/cts/src/android/healthconnect/cts/BasalBodyTemperatureRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/BasalBodyTemperatureRecordTest.java
@@ -139,8 +139,10 @@
                         new ReadRecordsRequestUsingFilters.Builder<>(
                                         BasalBodyTemperatureRecord.class)
                                 .build());
-        BasalBodyTemperatureRecord testRecord = getCompleteBasalBodyTemperatureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        List<Record> records =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteBasalBodyTemperatureRecord()));
+        BasalBodyTemperatureRecord testRecord = (BasalBodyTemperatureRecord) records.get(0);
         List<BasalBodyTemperatureRecord> newBasalBodyTemperatureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -163,8 +165,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        BasalBodyTemperatureRecord testRecord = getCompleteBasalBodyTemperatureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BasalBodyTemperatureRecord testRecord =
+                (BasalBodyTemperatureRecord)
+                        TestUtils.insertRecord(getCompleteBasalBodyTemperatureRecord());
         List<BasalBodyTemperatureRecord> newBasalBodyTemperatureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -192,8 +195,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        BasalBodyTemperatureRecord testRecord = getCompleteBasalBodyTemperatureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BasalBodyTemperatureRecord testRecord =
+                (BasalBodyTemperatureRecord)
+                        TestUtils.insertRecord(getCompleteBasalBodyTemperatureRecord());
         List<BasalBodyTemperatureRecord> newBasalBodyTemperatureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -420,10 +425,10 @@
     public void testDeleteBasalBodyTemperatureRecord_recordId_filters()
             throws InterruptedException {
         List<Record> records =
-                List.of(
-                        getBaseBasalBodyTemperatureRecord(),
-                        getCompleteBasalBodyTemperatureRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseBasalBodyTemperatureRecord(),
+                                getCompleteBasalBodyTemperatureRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -463,12 +468,12 @@
     @Test
     public void testDeleteBasalBodyTemperatureRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(
-                        getBaseBasalBodyTemperatureRecord(),
-                        getCompleteBasalBodyTemperatureRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseBasalBodyTemperatureRecord(),
+                                getCompleteBasalBodyTemperatureRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -509,8 +514,8 @@
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
         List<Record> testRecord =
-                Collections.singletonList(getCompleteBasalBodyTemperatureRecord());
-        TestUtils.insertRecords(testRecord);
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteBasalBodyTemperatureRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/BasalMetabolicRateRecordTest.java b/tests/cts/src/android/healthconnect/cts/BasalMetabolicRateRecordTest.java
index eb97dc2..0a7f971 100644
--- a/tests/cts/src/android/healthconnect/cts/BasalMetabolicRateRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/BasalMetabolicRateRecordTest.java
@@ -145,8 +145,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BasalMetabolicRateRecord.class)
                                 .build());
-        BasalMetabolicRateRecord testRecord = getCompleteBasalMetabolicRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BasalMetabolicRateRecord testRecord =
+                (BasalMetabolicRateRecord)
+                        TestUtils.insertRecord(getCompleteBasalMetabolicRateRecord());
         List<BasalMetabolicRateRecord> newBasalMetabolicRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BasalMetabolicRateRecord.class)
@@ -168,8 +169,9 @@
                         .setStartTime(Instant.now().minus(1, ChronoUnit.DAYS))
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        BasalMetabolicRateRecord testRecord = getCompleteBasalMetabolicRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BasalMetabolicRateRecord testRecord =
+                (BasalMetabolicRateRecord)
+                        TestUtils.insertRecord(getCompleteBasalMetabolicRateRecord());
         List<BasalMetabolicRateRecord> newBasalMetabolicRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BasalMetabolicRateRecord.class)
@@ -195,8 +197,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        BasalMetabolicRateRecord testRecord = getCompleteBasalMetabolicRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BasalMetabolicRateRecord testRecord =
+                (BasalMetabolicRateRecord)
+                        TestUtils.insertRecord(getCompleteBasalMetabolicRateRecord());
         List<BasalMetabolicRateRecord> newBasalMetabolicRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BasalMetabolicRateRecord.class)
@@ -252,8 +255,10 @@
     @Test
     public void testDeleteBasalMetabolicRateRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBasalMetabolicRateRecord(), getCompleteBasalMetabolicRateRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseBasalMetabolicRateRecord(),
+                                getCompleteBasalMetabolicRateRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -293,10 +298,12 @@
     @Test
     public void testDeleteBasalMetabolicRateRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBasalMetabolicRateRecord(), getCompleteBasalMetabolicRateRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseBasalMetabolicRateRecord(),
+                                getCompleteBasalMetabolicRateRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -1131,8 +1138,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteBasalMetabolicRateRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteBasalMetabolicRateRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/BloodGlucoseRecordTest.java b/tests/cts/src/android/healthconnect/cts/BloodGlucoseRecordTest.java
index d4e58e0..23dd461 100644
--- a/tests/cts/src/android/healthconnect/cts/BloodGlucoseRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/BloodGlucoseRecordTest.java
@@ -119,8 +119,8 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BloodGlucoseRecord.class)
                                 .build());
-        BloodGlucoseRecord testRecord = getCompleteBloodGlucoseRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BloodGlucoseRecord testRecord =
+                (BloodGlucoseRecord) TestUtils.insertRecord(getCompleteBloodGlucoseRecord());
         List<BloodGlucoseRecord> newBloodGlucoseRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BloodGlucoseRecord.class)
@@ -137,8 +137,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        BloodGlucoseRecord testRecord = getCompleteBloodGlucoseRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BloodGlucoseRecord testRecord =
+                (BloodGlucoseRecord) TestUtils.insertRecord(getCompleteBloodGlucoseRecord());
         List<BloodGlucoseRecord> newBloodGlucoseRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BloodGlucoseRecord.class)
@@ -161,8 +161,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        BloodGlucoseRecord testRecord = getCompleteBloodGlucoseRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BloodGlucoseRecord insertedRecord =
+                (BloodGlucoseRecord) TestUtils.insertRecord(getCompleteBloodGlucoseRecord());
         List<BloodGlucoseRecord> newBloodGlucoseRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BloodGlucoseRecord.class)
@@ -174,11 +174,11 @@
         assertThat(newBloodGlucoseRecords.size() - oldBloodGlucoseRecords.size()).isEqualTo(1);
         BloodGlucoseRecord newRecord =
                 newBloodGlucoseRecords.get(newBloodGlucoseRecords.size() - 1);
-        assertThat(newRecord.equals(testRecord)).isTrue();
-        assertThat(newRecord.getSpecimenSource()).isEqualTo(testRecord.getSpecimenSource());
-        assertThat(newRecord.getLevel()).isEqualTo(testRecord.getLevel());
-        assertThat(newRecord.getRelationToMeal()).isEqualTo(testRecord.getRelationToMeal());
-        assertThat(newRecord.getMealType()).isEqualTo(testRecord.getMealType());
+        assertThat(newRecord.equals(insertedRecord)).isTrue();
+        assertThat(newRecord.getSpecimenSource()).isEqualTo(insertedRecord.getSpecimenSource());
+        assertThat(newRecord.getLevel()).isEqualTo(insertedRecord.getLevel());
+        assertThat(newRecord.getRelationToMeal()).isEqualTo(insertedRecord.getRelationToMeal());
+        assertThat(newRecord.getMealType()).isEqualTo(insertedRecord.getMealType());
     }
 
     @Test
@@ -247,8 +247,8 @@
     @Test
     public void testDeleteBloodGlucoseRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBloodGlucoseRecord(), getCompleteBloodGlucoseRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseBloodGlucoseRecord(), getCompleteBloodGlucoseRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -288,14 +288,14 @@
     public void testDeleteBloodGlucoseRecord_usingIds() throws InterruptedException {
         List<Record> records =
                 List.of(getBaseBloodGlucoseRecord(), getCompleteBloodGlucoseRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> insertedRecords = TestUtils.insertRecords(records);
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : insertedRecords) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
         TestUtils.verifyDeleteRecords(recordIds);
-        for (Record record : records) {
+        for (Record record : insertedRecords) {
             TestUtils.assertRecordNotFound(record.getMetadata().getId(), record.getClass());
         }
     }
@@ -486,8 +486,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteBloodGlucoseRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteBloodGlucoseRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/BloodPressureRecordTest.java b/tests/cts/src/android/healthconnect/cts/BloodPressureRecordTest.java
index 72420cc..e449493 100644
--- a/tests/cts/src/android/healthconnect/cts/BloodPressureRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/BloodPressureRecordTest.java
@@ -138,8 +138,8 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BloodPressureRecord.class)
                                 .build());
-        BloodPressureRecord testRecord = getCompleteBloodPressureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BloodPressureRecord testRecord =
+                (BloodPressureRecord) TestUtils.insertRecord(getCompleteBloodPressureRecord());
         List<BloodPressureRecord> newBloodPressureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BloodPressureRecord.class)
@@ -159,8 +159,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        BloodPressureRecord testRecord = getCompleteBloodPressureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BloodPressureRecord testRecord =
+                (BloodPressureRecord) TestUtils.insertRecord(getCompleteBloodPressureRecord());
         List<BloodPressureRecord> newBloodPressureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BloodPressureRecord.class)
@@ -186,8 +186,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        BloodPressureRecord testRecord = getCompleteBloodPressureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BloodPressureRecord testRecord =
+                (BloodPressureRecord) TestUtils.insertRecord(getCompleteBloodPressureRecord());
         List<BloodPressureRecord> newBloodPressureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BloodPressureRecord.class)
@@ -273,8 +273,8 @@
     @Test
     public void testDeleteBloodPressureRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBloodPressureRecord(), getCompleteBloodPressureRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseBloodPressureRecord(), getCompleteBloodPressureRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -313,10 +313,10 @@
     @Test
     public void testDeleteBloodPressureRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBloodPressureRecord(), getCompleteBloodPressureRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseBloodPressureRecord(), getCompleteBloodPressureRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -579,8 +579,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteBloodPressureRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteBloodPressureRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/BodyFatRecordTest.java b/tests/cts/src/android/healthconnect/cts/BodyFatRecordTest.java
index 978f13c..584f36e 100644
--- a/tests/cts/src/android/healthconnect/cts/BodyFatRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/BodyFatRecordTest.java
@@ -117,8 +117,9 @@
         List<BodyFatRecord> oldBodyFatRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyFatRecord.class).build());
-        BodyFatRecord testRecord = getCompleteBodyFatRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BodyFatRecord testRecord =
+                (BodyFatRecord) TestUtils.insertRecord(getCompleteBodyFatRecord());
         List<BodyFatRecord> newBodyFatRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyFatRecord.class).build());
@@ -133,8 +134,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        BodyFatRecord testRecord = getCompleteBodyFatRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BodyFatRecord testRecord =
+                (BodyFatRecord) TestUtils.insertRecord(getCompleteBodyFatRecord());
         List<BodyFatRecord> newBodyFatRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyFatRecord.class)
@@ -155,8 +156,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        BodyFatRecord testRecord = getCompleteBodyFatRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        BodyFatRecord testRecord =
+                (BodyFatRecord) TestUtils.insertRecord(getCompleteBodyFatRecord());
         List<BodyFatRecord> newBodyFatRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyFatRecord.class)
@@ -235,8 +236,9 @@
 
     @Test
     public void testDeleteBodyFatRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseBodyFatRecord(), getCompleteBodyFatRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseBodyFatRecord(), getCompleteBodyFatRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -273,10 +275,11 @@
 
     @Test
     public void testDeleteBodyFatRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseBodyFatRecord(), getCompleteBodyFatRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseBodyFatRecord(), getCompleteBodyFatRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -453,8 +456,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteBodyFatRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteBodyFatRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/BodyTemperatureRecordTest.java b/tests/cts/src/android/healthconnect/cts/BodyTemperatureRecordTest.java
index 5089e97..1c47d2b 100644
--- a/tests/cts/src/android/healthconnect/cts/BodyTemperatureRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/BodyTemperatureRecordTest.java
@@ -131,8 +131,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyTemperatureRecord.class)
                                 .build());
-        BodyTemperatureRecord testRecord = getCompleteBodyTemperatureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BodyTemperatureRecord testRecord =
+                (BodyTemperatureRecord) TestUtils.insertRecord(getCompleteBodyTemperatureRecord());
         List<BodyTemperatureRecord> newBodyTemperatureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyTemperatureRecord.class)
@@ -153,8 +154,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        BodyTemperatureRecord testRecord = getCompleteBodyTemperatureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BodyTemperatureRecord testRecord =
+                (BodyTemperatureRecord) TestUtils.insertRecord(getCompleteBodyTemperatureRecord());
         List<BodyTemperatureRecord> newBodyTemperatureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyTemperatureRecord.class)
@@ -180,8 +182,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        BodyTemperatureRecord testRecord = getCompleteBodyTemperatureRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BodyTemperatureRecord testRecord =
+                (BodyTemperatureRecord) TestUtils.insertRecord(getCompleteBodyTemperatureRecord());
         List<BodyTemperatureRecord> newBodyTemperatureRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyTemperatureRecord.class)
@@ -266,8 +269,10 @@
     @Test
     public void testDeleteBodyTemperatureRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBodyTemperatureRecord(), getCompleteBodyTemperatureRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseBodyTemperatureRecord(),
+                                getCompleteBodyTemperatureRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -306,10 +311,12 @@
     @Test
     public void testDeleteBodyTemperatureRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBodyTemperatureRecord(), getCompleteBodyTemperatureRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseBodyTemperatureRecord(),
+                                getCompleteBodyTemperatureRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -485,8 +492,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteBodyTemperatureRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteBodyTemperatureRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/BodyWaterMassRecordTest.java b/tests/cts/src/android/healthconnect/cts/BodyWaterMassRecordTest.java
index 12d3a6e..e892bf3 100644
--- a/tests/cts/src/android/healthconnect/cts/BodyWaterMassRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/BodyWaterMassRecordTest.java
@@ -81,7 +81,10 @@
     @Test
     public void testReadBodyWaterMassRecord_usingIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(getCompleteBodyWaterMassRecord(), getCompleteBodyWaterMassRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                getCompleteBodyWaterMassRecord(),
+                                getCompleteBodyWaterMassRecord()));
         readBodyWaterMassRecordUsingIds(recordList);
     }
 
@@ -119,8 +122,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyWaterMassRecord.class)
                                 .build());
-        BodyWaterMassRecord testRecord = getCompleteBodyWaterMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BodyWaterMassRecord testRecord =
+                (BodyWaterMassRecord) TestUtils.insertRecord(getCompleteBodyWaterMassRecord());
         List<BodyWaterMassRecord> newBodyWaterMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyWaterMassRecord.class)
@@ -140,8 +144,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        BodyWaterMassRecord testRecord = getCompleteBodyWaterMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BodyWaterMassRecord testRecord =
+                (BodyWaterMassRecord) TestUtils.insertRecord(getCompleteBodyWaterMassRecord());
         List<BodyWaterMassRecord> newBodyWaterMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyWaterMassRecord.class)
@@ -167,8 +172,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        BodyWaterMassRecord testRecord = getCompleteBodyWaterMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BodyWaterMassRecord testRecord =
+                (BodyWaterMassRecord) TestUtils.insertRecord(getCompleteBodyWaterMassRecord());
         List<BodyWaterMassRecord> newBodyWaterMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BodyWaterMassRecord.class)
@@ -222,8 +228,8 @@
     @Test
     public void testDeleteBodyWaterMassRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBodyWaterMassRecord(), getCompleteBodyWaterMassRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseBodyWaterMassRecord(), getCompleteBodyWaterMassRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -262,10 +268,10 @@
     @Test
     public void testDeleteBodyWaterMassRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseBodyWaterMassRecord(), getCompleteBodyWaterMassRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseBodyWaterMassRecord(), getCompleteBodyWaterMassRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -465,8 +471,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteBodyWaterMassRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteBodyWaterMassRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -498,9 +505,8 @@
         assertThat(result).containsExactlyElementsIn(insertedRecord);
     }
 
-    private void readBodyWaterMassRecordUsingIds(List<Record> recordList)
+    private void readBodyWaterMassRecordUsingIds(List<Record> insertedRecords)
             throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
         ReadRecordsRequestUsingIds.Builder<BodyWaterMassRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(BodyWaterMassRecord.class);
         for (Record record : insertedRecords) {
@@ -511,7 +517,7 @@
         assertThat(requestUsingIds.getRecordIdFilters()).isNotNull();
         List<BodyWaterMassRecord> result = TestUtils.readRecords(requestUsingIds);
         assertThat(result).hasSize(insertedRecords.size());
-        assertThat(result).containsExactlyElementsIn(recordList);
+        assertThat(result).containsExactlyElementsIn(insertedRecords);
     }
 
     @Test(expected = IllegalArgumentException.class)
diff --git a/tests/cts/src/android/healthconnect/cts/BoneMassRecordTest.java b/tests/cts/src/android/healthconnect/cts/BoneMassRecordTest.java
index 50d9e47..dcd58d1 100644
--- a/tests/cts/src/android/healthconnect/cts/BoneMassRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/BoneMassRecordTest.java
@@ -117,8 +117,9 @@
         List<BoneMassRecord> oldBoneMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BoneMassRecord.class).build());
-        BoneMassRecord testRecord = getCompleteBoneMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BoneMassRecord testRecord =
+                (BoneMassRecord) TestUtils.insertRecord(getCompleteBoneMassRecord());
         List<BoneMassRecord> newBoneMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BoneMassRecord.class).build());
@@ -134,8 +135,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        BoneMassRecord testRecord = getCompleteBoneMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BoneMassRecord testRecord =
+                (BoneMassRecord) TestUtils.insertRecord(getCompleteBoneMassRecord());
         List<BoneMassRecord> newBoneMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BoneMassRecord.class)
@@ -158,8 +160,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        BoneMassRecord testRecord = getCompleteBoneMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        BoneMassRecord testRecord =
+                (BoneMassRecord) TestUtils.insertRecord(getCompleteBoneMassRecord());
         List<BoneMassRecord> newBoneMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(BoneMassRecord.class)
@@ -239,9 +242,9 @@
     @Test
     public void testDeleteBoneMassRecord_recordId_filters() throws InterruptedException {
         List<Record> records = List.of(getBaseBoneMassRecord(), getCompleteBoneMassRecord());
-        TestUtils.insertRecords(records);
+        List<Record> insertedRecords = TestUtils.insertRecords(records);
 
-        for (Record record : records) {
+        for (Record record : insertedRecords) {
             TestUtils.verifyDeleteRecords(
                     new DeleteUsingFiltersRequest.Builder()
                             .addRecordType(record.getClass())
@@ -276,10 +279,11 @@
 
     @Test
     public void testDeleteBoneMassRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseBoneMassRecord(), getCompleteBoneMassRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseBoneMassRecord(), getCompleteBoneMassRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -450,8 +454,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteBoneMassRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteBoneMassRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/CervicalMucusRecordTest.java b/tests/cts/src/android/healthconnect/cts/CervicalMucusRecordTest.java
index 408a6e8..95bc5c0 100644
--- a/tests/cts/src/android/healthconnect/cts/CervicalMucusRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/CervicalMucusRecordTest.java
@@ -118,8 +118,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(CervicalMucusRecord.class)
                                 .build());
-        CervicalMucusRecord testRecord = getCompleteCervicalMucusRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        CervicalMucusRecord testRecord =
+                (CervicalMucusRecord) TestUtils.insertRecord(getCompleteCervicalMucusRecord());
         List<CervicalMucusRecord> newCervicalMucusRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(CervicalMucusRecord.class)
@@ -139,8 +140,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        CervicalMucusRecord testRecord = getCompleteCervicalMucusRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        CervicalMucusRecord testRecord =
+                (CervicalMucusRecord) TestUtils.insertRecord(getCompleteCervicalMucusRecord());
         List<CervicalMucusRecord> newCervicalMucusRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(CervicalMucusRecord.class)
@@ -166,8 +168,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        CervicalMucusRecord testRecord = getCompleteCervicalMucusRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        CervicalMucusRecord testRecord =
+                (CervicalMucusRecord) TestUtils.insertRecord(getCompleteCervicalMucusRecord());
         List<CervicalMucusRecord> newCervicalMucusRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(CervicalMucusRecord.class)
@@ -250,8 +253,8 @@
     @Test
     public void testDeleteCervicalMucusRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseCervicalMucusRecord(), getCompleteCervicalMucusRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseCervicalMucusRecord(), getCompleteCervicalMucusRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -290,10 +293,10 @@
     @Test
     public void testDeleteCervicalMucusRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseCervicalMucusRecord(), getCompleteCervicalMucusRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseCervicalMucusRecord(), getCompleteCervicalMucusRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -463,8 +466,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteCervicalMucusRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteCervicalMucusRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/CyclingPedalingCadenceRecordTest.java b/tests/cts/src/android/healthconnect/cts/CyclingPedalingCadenceRecordTest.java
index ff7a69a..a36f265 100644
--- a/tests/cts/src/android/healthconnect/cts/CyclingPedalingCadenceRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/CyclingPedalingCadenceRecordTest.java
@@ -146,8 +146,10 @@
                         new ReadRecordsRequestUsingFilters.Builder<>(
                                         CyclingPedalingCadenceRecord.class)
                                 .build());
-        CyclingPedalingCadenceRecord testRecord = getCompleteCyclingPedalingCadenceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        CyclingPedalingCadenceRecord testRecord =
+                (CyclingPedalingCadenceRecord)
+                        TestUtils.insertRecord(getCompleteCyclingPedalingCadenceRecord());
         List<CyclingPedalingCadenceRecord> newCyclingPedalingCadenceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -170,8 +172,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        CyclingPedalingCadenceRecord testRecord = getCompleteCyclingPedalingCadenceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        CyclingPedalingCadenceRecord testRecord =
+                (CyclingPedalingCadenceRecord)
+                        TestUtils.insertRecord(getCompleteCyclingPedalingCadenceRecord());
         List<CyclingPedalingCadenceRecord> newCyclingPedalingCadenceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -199,8 +203,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        CyclingPedalingCadenceRecord testRecord = getCompleteCyclingPedalingCadenceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        CyclingPedalingCadenceRecord testRecord =
+                (CyclingPedalingCadenceRecord)
+                        TestUtils.insertRecord(getCompleteCyclingPedalingCadenceRecord());
         List<CyclingPedalingCadenceRecord> newCyclingPedalingCadenceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -272,10 +277,10 @@
     public void testDeleteCyclingPedalingCadenceRecord_recordId_filters()
             throws InterruptedException {
         List<Record> records =
-                List.of(
-                        getBaseCyclingPedalingCadenceRecord(),
-                        getCompleteCyclingPedalingCadenceRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseCyclingPedalingCadenceRecord(),
+                                getCompleteCyclingPedalingCadenceRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -315,12 +320,12 @@
     @Test
     public void testDeleteCyclingPedalingCadenceRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(
-                        getBaseCyclingPedalingCadenceRecord(),
-                        getCompleteCyclingPedalingCadenceRecord());
-        List<Record> insertedRecords = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseCyclingPedalingCadenceRecord(),
+                                getCompleteCyclingPedalingCadenceRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecords) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -507,8 +512,8 @@
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
         List<Record> testRecord =
-                Collections.singletonList(getCompleteCyclingPedalingCadenceRecord());
-        TestUtils.insertRecords(testRecord);
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteCyclingPedalingCadenceRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -571,9 +576,10 @@
 
     private void testReadCyclingPedalingCadenceRecordIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(
-                        getCompleteCyclingPedalingCadenceRecord(),
-                        getCompleteCyclingPedalingCadenceRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                getCompleteCyclingPedalingCadenceRecord(),
+                                getCompleteCyclingPedalingCadenceRecord()));
         readCyclingPedalingCadenceRecordUsingIds(recordList);
     }
 
@@ -588,9 +594,8 @@
         assertThat(result.containsAll(insertedRecords)).isTrue();
     }
 
-    private void readCyclingPedalingCadenceRecordUsingIds(List<Record> recordList)
+    private void readCyclingPedalingCadenceRecordUsingIds(List<Record> insertedRecords)
             throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
         ReadRecordsRequestUsingIds.Builder<CyclingPedalingCadenceRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(CyclingPedalingCadenceRecord.class);
         for (Record record : insertedRecords) {
diff --git a/tests/cts/src/android/healthconnect/cts/DistanceRecordTest.java b/tests/cts/src/android/healthconnect/cts/DistanceRecordTest.java
index 547be9f..cf5f32c 100644
--- a/tests/cts/src/android/healthconnect/cts/DistanceRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/DistanceRecordTest.java
@@ -143,8 +143,9 @@
         List<DistanceRecord> oldDistanceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(DistanceRecord.class).build());
-        DistanceRecord testRecord = getCompleteDistanceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        DistanceRecord testRecord =
+                (DistanceRecord) TestUtils.insertRecord(getCompleteDistanceRecord());
         List<DistanceRecord> newDistanceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(DistanceRecord.class).build());
@@ -160,8 +161,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        DistanceRecord testRecord = getCompleteDistanceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        DistanceRecord testRecord =
+                (DistanceRecord) TestUtils.insertRecord(getCompleteDistanceRecord());
         List<DistanceRecord> newDistanceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(DistanceRecord.class)
@@ -184,8 +186,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        DistanceRecord testRecord = getCompleteDistanceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        DistanceRecord testRecord =
+                (DistanceRecord) TestUtils.insertRecord(getCompleteDistanceRecord());
         List<DistanceRecord> newDistanceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(DistanceRecord.class)
@@ -238,8 +241,9 @@
 
     @Test
     public void testDeleteDistanceRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseDistanceRecord(), getCompleteDistanceRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseDistanceRecord(), getCompleteDistanceRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -276,10 +280,11 @@
 
     @Test
     public void testDeleteDistanceRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseDistanceRecord(), getCompleteDistanceRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseDistanceRecord(), getCompleteDistanceRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -532,8 +537,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteDistanceRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteDistanceRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/ElevationGainedRecordTest.java b/tests/cts/src/android/healthconnect/cts/ElevationGainedRecordTest.java
index 7b678e3..4ae5117 100644
--- a/tests/cts/src/android/healthconnect/cts/ElevationGainedRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/ElevationGainedRecordTest.java
@@ -135,8 +135,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(ElevationGainedRecord.class)
                                 .build());
-        ElevationGainedRecord testRecord = getCompleteElevationGainedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        ElevationGainedRecord testRecord =
+                (ElevationGainedRecord) TestUtils.insertRecord(getCompleteElevationGainedRecord());
         List<ElevationGainedRecord> newElevationGainedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(ElevationGainedRecord.class)
@@ -157,8 +158,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        ElevationGainedRecord testRecord = getCompleteElevationGainedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        ElevationGainedRecord testRecord =
+                (ElevationGainedRecord) TestUtils.insertRecord(getCompleteElevationGainedRecord());
         List<ElevationGainedRecord> newElevationGainedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(ElevationGainedRecord.class)
@@ -184,8 +186,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        ElevationGainedRecord testRecord = getCompleteElevationGainedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        ElevationGainedRecord testRecord =
+                (ElevationGainedRecord) TestUtils.insertRecord(getCompleteElevationGainedRecord());
         List<ElevationGainedRecord> newElevationGainedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(ElevationGainedRecord.class)
@@ -241,8 +244,10 @@
     @Test
     public void testDeleteElevationGainedRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseElevationGainedRecord(), getCompleteElevationGainedRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseElevationGainedRecord(),
+                                getCompleteElevationGainedRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -281,10 +286,12 @@
     @Test
     public void testDeleteElevationGainedRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseElevationGainedRecord(), getCompleteElevationGainedRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseElevationGainedRecord(),
+                                getCompleteElevationGainedRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -548,8 +555,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteElevationGainedRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteElevationGainedRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/ExerciseRouteDisabledFeatureTest.java b/tests/cts/src/android/healthconnect/cts/ExerciseRouteDisabledFeatureTest.java
index 2c9045a..2a7a83f 100644
--- a/tests/cts/src/android/healthconnect/cts/ExerciseRouteDisabledFeatureTest.java
+++ b/tests/cts/src/android/healthconnect/cts/ExerciseRouteDisabledFeatureTest.java
@@ -62,15 +62,15 @@
     @Test
     public void testReadRoute_insertAndRead_routeIsNotAvailable() throws InterruptedException {
         List<Record> records = List.of(TestUtils.buildExerciseSession());
-        TestUtils.insertRecords(records);
+        List<Record> insertedRecords = TestUtils.insertRecords(records);
         setExerciseRouteFeatureEnabledFlag(false);
-        ExerciseSessionRecord insertedRecord = (ExerciseSessionRecord) records.get(0);
+        ExerciseSessionRecord insertedRecord = (ExerciseSessionRecord) insertedRecords.get(0);
         assertThat(insertedRecord.hasRoute()).isTrue();
         assertThat(insertedRecord.getRoute()).isNotNull();
 
         ReadRecordsRequestUsingIds.Builder<ExerciseSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(ExerciseSessionRecord.class);
-        request.addId(records.get(0).getMetadata().getId());
+        request.addId(insertedRecords.get(0).getMetadata().getId());
         ExerciseSessionRecord readRecord = TestUtils.readRecords(request.build()).get(0);
         assertThat(readRecord.hasRoute()).isFalse();
         assertThat(readRecord.getRoute()).isNull();
diff --git a/tests/cts/src/android/healthconnect/cts/ExerciseSessionRecordTest.java b/tests/cts/src/android/healthconnect/cts/ExerciseSessionRecordTest.java
index 0a70837..8e1565d 100644
--- a/tests/cts/src/android/healthconnect/cts/ExerciseSessionRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/ExerciseSessionRecordTest.java
@@ -178,11 +178,11 @@
                                 ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AMERICAN)
                         .setRoute(route)
                         .build();
-        List<Record> recordList = TestUtils.insertRecords(Collections.singletonList(record));
+        ExerciseSessionRecord testRecord = (ExerciseSessionRecord) TestUtils.insertRecord(record);
 
         ReadRecordsRequestUsingIds.Builder<ExerciseSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(ExerciseSessionRecord.class);
-        request.addId(recordList.get(0).getMetadata().getId());
+        request.addId(testRecord.getMetadata().getId());
 
         ExerciseSessionRecord insertedRecord = TestUtils.readRecords(request.build()).get(0);
         assertThat(insertedRecord.hasRoute()).isTrue();
@@ -191,7 +191,7 @@
         TestUtils.updateRecords(
                 Collections.singletonList(
                         getExerciseSessionRecord_update(
-                                record, recordList.get(0).getMetadata().getId(), null)));
+                                record, testRecord.getMetadata().getId(), null)));
 
         insertedRecord = TestUtils.readRecords(request.build()).get(0);
         assertThat(insertedRecord.hasRoute()).isFalse();
@@ -320,18 +320,9 @@
     }
 
     @Test
-    public void testInsertRecord_apiReturnsRequestedRecords() throws InterruptedException {
-        List<Record> records =
-                Arrays.asList(TestUtils.buildExerciseSession(), TestUtils.buildExerciseSession());
-        List<Record> insertedRecords = TestUtils.insertRecords(records);
-        assertThat(records.size()).isEqualTo(insertedRecords.size());
-        assertThat(records).containsExactlyElementsIn(insertedRecords);
-    }
-
-    @Test
     public void testReadById_insertAndReadById_recordsAreEqual() throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildExerciseSession(), buildSessionMinimal());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(buildExerciseSession(), buildSessionMinimal()));
 
         ReadRecordsRequestUsingIds.Builder<ExerciseSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(ExerciseSessionRecord.class);
@@ -343,8 +334,7 @@
 
     @Test
     public void testReadById_insertAndReadByIdOne_recordsAreEqual() throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildExerciseSession());
-        TestUtils.insertRecords(records);
+        List<Record> records = TestUtils.insertRecords(List.of(buildExerciseSession()));
 
         ReadRecordsRequestUsingIds.Builder<ExerciseSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(ExerciseSessionRecord.class);
@@ -362,8 +352,8 @@
     @Test
     public void testReadByClientId_insertAndReadByClientId_recordsAreEqual()
             throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildExerciseSession(), buildSessionMinimal());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(buildExerciseSession(), buildSessionMinimal()));
 
         ReadRecordsRequestUsingIds.Builder<ExerciseSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(ExerciseSessionRecord.class);
@@ -376,8 +366,9 @@
     @Test
     public void testReadByClientId_insertAndReadByDefaultFilter_filteredAll()
             throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildExerciseSession(), buildSessionMinimal());
-        assertThat(TestUtils.insertRecords(records)).hasSize(2);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(buildExerciseSession(), buildSessionMinimal()));
+        assertThat(records).hasSize(2);
 
         List<ExerciseSessionRecord> readRecords =
                 TestUtils.readRecords(
@@ -389,8 +380,8 @@
     @Test
     public void testReadByClientId_insertAndReadByTimeFilter_filteredCorrectly()
             throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildExerciseSession(), buildSessionMinimal());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(buildExerciseSession(), buildSessionMinimal()));
 
         TimeInstantRangeFilter filter =
                 new TimeInstantRangeFilter.Builder()
@@ -413,15 +404,15 @@
     @Test
     public void testDeleteRecords_insertAndDeleteById_recordsNotFoundAnymore()
             throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildExerciseSession(), buildSessionMinimal());
-        List<Record> insertedRecords = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(buildExerciseSession(), buildSessionMinimal()));
 
         TestUtils.assertRecordFound(
                 records.get(0).getMetadata().getId(), ExerciseSessionRecord.class);
         TestUtils.assertRecordFound(
                 records.get(1).getMetadata().getId(), ExerciseSessionRecord.class);
 
-        TestUtils.deleteRecords(insertedRecords);
+        TestUtils.deleteRecords(records);
 
         TestUtils.assertRecordNotFound(
                 records.get(0).getMetadata().getId(), ExerciseSessionRecord.class);
@@ -567,8 +558,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(buildExerciseSession());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(buildExerciseSession()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/FloorsClimbedRecordTest.java b/tests/cts/src/android/healthconnect/cts/FloorsClimbedRecordTest.java
index e2b3ff6..eb58b1b 100644
--- a/tests/cts/src/android/healthconnect/cts/FloorsClimbedRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/FloorsClimbedRecordTest.java
@@ -135,8 +135,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(FloorsClimbedRecord.class)
                                 .build());
-        FloorsClimbedRecord testRecord = getCompleteFloorsClimbedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        FloorsClimbedRecord testRecord =
+                (FloorsClimbedRecord) TestUtils.insertRecord(getCompleteFloorsClimbedRecord());
         List<FloorsClimbedRecord> newFloorsClimbedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(FloorsClimbedRecord.class)
@@ -156,8 +157,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        FloorsClimbedRecord testRecord = getCompleteFloorsClimbedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        FloorsClimbedRecord testRecord =
+                (FloorsClimbedRecord) TestUtils.insertRecord(getCompleteFloorsClimbedRecord());
         List<FloorsClimbedRecord> newFloorsClimbedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(FloorsClimbedRecord.class)
@@ -183,8 +185,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        FloorsClimbedRecord testRecord = getCompleteFloorsClimbedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        FloorsClimbedRecord testRecord =
+                (FloorsClimbedRecord) TestUtils.insertRecord(getCompleteFloorsClimbedRecord());
         List<FloorsClimbedRecord> newFloorsClimbedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(FloorsClimbedRecord.class)
@@ -446,8 +449,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteFloorsClimbedRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteFloorsClimbedRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/GetActivityDatesTest.java b/tests/cts/src/android/healthconnect/cts/GetActivityDatesTest.java
index ff009ba..51eb137 100644
--- a/tests/cts/src/android/healthconnect/cts/GetActivityDatesTest.java
+++ b/tests/cts/src/android/healthconnect/cts/GetActivityDatesTest.java
@@ -84,17 +84,21 @@
     @Test
     public void testGetActivityDates_onUpdate() throws InterruptedException {
         List<Record> records = getTestRecords();
-        TestUtils.insertRecords(records);
+        List<Record> insertedRecords = TestUtils.insertRecords(records);
         // Wait for some time, as activity dates are updated in the background so might take some
         // additional time.
         Thread.sleep(500);
         List<LocalDate> activityDates =
                 TestUtils.getActivityDates(
-                        records.stream().map(Record::getClass).collect(Collectors.toList()));
+                        insertedRecords.stream()
+                                .map(Record::getClass)
+                                .collect(Collectors.toList()));
         assertThat(activityDates.size()).isGreaterThan(1);
         assertThat(activityDates)
                 .containsExactlyElementsIn(
-                        records.stream().map(this::getRecordDate).collect(Collectors.toSet()));
+                        insertedRecords.stream()
+                                .map(this::getRecordDate)
+                                .collect(Collectors.toSet()));
         List<Record> updatedRecords = getTestRecords();
 
         for (int itr = 0; itr < updatedRecords.size(); itr++) {
@@ -102,9 +106,12 @@
                     itr,
                     new StepsRecord.Builder(
                                     new Metadata.Builder()
-                                            .setId(records.get(itr).getMetadata().getId())
+                                            .setId(insertedRecords.get(itr).getMetadata().getId())
                                             .setDataOrigin(
-                                                    records.get(itr).getMetadata().getDataOrigin())
+                                                    insertedRecords
+                                                            .get(itr)
+                                                            .getMetadata()
+                                                            .getDataOrigin())
                                             .build(),
                                     Instant.now().minusSeconds(5000 + itr * 2L),
                                     Instant.now().minusSeconds(itr * 2L),
diff --git a/tests/cts/src/android/healthconnect/cts/HealthConnectChangeLogsTests.java b/tests/cts/src/android/healthconnect/cts/HealthConnectChangeLogsTests.java
index bba6498..dc7f410 100644
--- a/tests/cts/src/android/healthconnect/cts/HealthConnectChangeLogsTests.java
+++ b/tests/cts/src/android/healthconnect/cts/HealthConnectChangeLogsTests.java
@@ -85,8 +85,7 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord = TestUtils.insertRecords(TestUtils.getTestRecords());
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(testRecord.size());
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
@@ -108,8 +107,7 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecord);
+        TestUtils.insertRecords(TestUtils.getTestRecords());
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
@@ -134,8 +132,7 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord = TestUtils.insertRecords(TestUtils.getTestRecords());
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(testRecord.size());
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
@@ -159,13 +156,13 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(TestUtils.getStepsRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(TestUtils.getStepsRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
-        testRecord = Collections.singletonList(TestUtils.getHeartRateRecord());
-        TestUtils.insertRecords(testRecord);
+        testRecord =
+                TestUtils.insertRecords(Collections.singletonList(TestUtils.getHeartRateRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
@@ -180,8 +177,7 @@
         ChangeLogsResponse response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
 
-        List<Record> testRecord = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord = TestUtils.insertRecords(TestUtils.getTestRecords());
         TestUtils.deleteRecords(testRecord);
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
@@ -207,11 +203,11 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
 
         List<Record> testRecord =
-                Arrays.asList(
-                        StepsRecordTest.getStepsRecord_minusDays(45),
-                        StepsRecordTest.getStepsRecord_minusDays(20),
-                        StepsRecordTest.getStepsRecord_minusDays(5));
-        TestUtils.insertRecords(testRecord);
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                StepsRecordTest.getStepsRecord_minusDays(45),
+                                StepsRecordTest.getStepsRecord_minusDays(20),
+                                StepsRecordTest.getStepsRecord_minusDays(5)));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(2);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
@@ -237,8 +233,7 @@
         ChangeLogsResponse response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
 
-        List<Record> testRecord = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord = TestUtils.insertRecords(TestUtils.getTestRecords());
         TestUtils.deleteRecords(testRecord);
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
@@ -264,8 +259,7 @@
         ChangeLogsResponse response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
 
-        List<Record> testRecord = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord = TestUtils.insertRecords(TestUtils.getTestRecords());
         TestUtils.deleteRecords(testRecord);
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
@@ -292,14 +286,14 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(TestUtils.getStepsRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(TestUtils.getStepsRecord()));
         TestUtils.deleteRecords(testRecord);
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(1);
-        testRecord = Collections.singletonList(TestUtils.getHeartRateRecord());
-        TestUtils.insertRecords(testRecord);
+        testRecord =
+                TestUtils.insertRecords(Collections.singletonList(TestUtils.getHeartRateRecord()));
         TestUtils.deleteRecords(testRecord);
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
@@ -360,8 +354,7 @@
         ChangeLogsResponse response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.hasMorePages()).isFalse();
-        List<Record> testRecord = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord = TestUtils.insertRecords(TestUtils.getTestRecords());
         ChangeLogsResponse newResponse = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(newResponse.getUpsertedRecords().size()).isEqualTo(testRecord.size());
     }
@@ -378,8 +371,7 @@
         ChangeLogsResponse response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.hasMorePages()).isFalse();
-        List<Record> testRecord = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord = TestUtils.insertRecords(TestUtils.getTestRecords());
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(testRecord.size());
         assertThat(response.hasMorePages()).isFalse();
diff --git a/tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java b/tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java
index 5538d10..82a1fe1 100644
--- a/tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java
+++ b/tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java
@@ -1632,7 +1632,7 @@
         StepsRecord testRecord = TestUtils.getStepsRecord();
 
         try {
-            TestUtils.insertRecords(Collections.singletonList(testRecord));
+            testRecord = (StepsRecord) TestUtils.insertRecord(testRecord);
             Assert.fail();
         } catch (HealthConnectException exception) {
             assertThat(exception).isNotNull();
@@ -1788,8 +1788,7 @@
     public void testGetRecordTypeInfo_InsertRecords_correctContributingPackages() throws Exception {
         // Insert a set of test records for StepRecords, ExerciseSessionRecord, HeartRateRecord,
         // BasalMetabolicRateRecord.
-        List<Record> testRecords = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecords);
+        List<Record> testRecords = TestUtils.insertRecords(TestUtils.getTestRecords());
 
         // Populate expected records. This method puts empty lists as contributing packages for all
         // records.
@@ -1849,8 +1848,7 @@
             throws Exception {
         // Insert a sets of test records for StepRecords, ExerciseSessionRecord, HeartRateRecord,
         // BasalMetabolicRateRecord.
-        List<Record> testRecords = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecords);
+        List<Record> testRecords = TestUtils.insertRecords(TestUtils.getTestRecords());
 
         // Populate expected records. This method puts empty lists as contributing packages for all
         // records.
@@ -1914,11 +1912,9 @@
             throws Exception {
         // Insert 2 sets of test records for StepRecords, ExerciseSessionRecord, HeartRateRecord,
         // BasalMetabolicRateRecord.
-        List<Record> testRecords = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecords);
+        List<Record> testRecords = TestUtils.insertRecords(TestUtils.getTestRecords());
 
-        List<Record> testRecords2 = TestUtils.getTestRecords();
-        TestUtils.insertRecords(testRecords2);
+        TestUtils.insertRecords(TestUtils.getTestRecords());
 
         // When recordTypes are modified the appInfo also gets updated and this update happens on
         // a background thread. To ensure the test has the latest values for appInfo, add a wait
diff --git a/tests/cts/src/android/healthconnect/cts/HeartRateRecordTest.java b/tests/cts/src/android/healthconnect/cts/HeartRateRecordTest.java
index 623c8ed..e9f53b4 100644
--- a/tests/cts/src/android/healthconnect/cts/HeartRateRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/HeartRateRecordTest.java
@@ -153,8 +153,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HeartRateRecord.class)
                                 .build());
-        HeartRateRecord testRecord = getCompleteHeartRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeartRateRecord testRecord =
+                (HeartRateRecord) TestUtils.insertRecord(getCompleteHeartRateRecord());
         List<HeartRateRecord> newHeartRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HeartRateRecord.class)
@@ -171,8 +172,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        HeartRateRecord testRecord = getCompleteHeartRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeartRateRecord testRecord =
+                (HeartRateRecord) TestUtils.insertRecord(getCompleteHeartRateRecord());
         ReadRecordsRequestUsingFilters<HeartRateRecord> requestUsingFilters =
                 new ReadRecordsRequestUsingFilters.Builder<>(HeartRateRecord.class)
                         .setTimeRangeFilter(filter)
@@ -198,8 +200,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        HeartRateRecord testRecord = getCompleteHeartRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeartRateRecord testRecord =
+                (HeartRateRecord) TestUtils.insertRecord(getCompleteHeartRateRecord());
         List<HeartRateRecord> newHeartRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HeartRateRecord.class)
@@ -367,8 +370,9 @@
 
     @Test
     public void testDeleteHeartRateRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseHeartRateRecord(10), getCompleteHeartRateRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseHeartRateRecord(10), getCompleteHeartRateRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -406,10 +410,11 @@
 
     @Test
     public void testDeleteHeartRateRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseHeartRateRecord(10), getCompleteHeartRateRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseHeartRateRecord(10), getCompleteHeartRateRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
         for (RecordIdFilter recordIdFilter : recordIds) {
@@ -426,10 +431,11 @@
 
     @Test
     public void testDeleteHeartRateRecord_usingInvalidClientIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseHeartRateRecord(10), getCompleteHeartRateRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseHeartRateRecord(10), getCompleteHeartRateRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(
                     RecordIdFilter.fromClientRecordId(
                             record.getClass(), record.getMetadata().getId()));
@@ -812,8 +818,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteHeartRateRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteHeartRateRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -978,7 +984,8 @@
 
     private void testReadHeartRateRecordIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(getCompleteHeartRateRecord(), getCompleteHeartRateRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(getCompleteHeartRateRecord(), getCompleteHeartRateRecord()));
         readHeartRateRecordUsingIds(recordList);
     }
 
@@ -994,8 +1001,8 @@
         assertThat(result).containsExactlyElementsIn(insertedRecord);
     }
 
-    private void readHeartRateRecordUsingIds(List<Record> recordList) throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
+    private void readHeartRateRecordUsingIds(List<Record> insertedRecords)
+            throws InterruptedException {
         ReadRecordsRequestUsingIds.Builder<HeartRateRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(HeartRateRecord.class);
         for (Record record : insertedRecords) {
diff --git a/tests/cts/src/android/healthconnect/cts/HeartRateVariabilityRmssdRecordTest.java b/tests/cts/src/android/healthconnect/cts/HeartRateVariabilityRmssdRecordTest.java
index 72a0fbb..e69a125 100644
--- a/tests/cts/src/android/healthconnect/cts/HeartRateVariabilityRmssdRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/HeartRateVariabilityRmssdRecordTest.java
@@ -82,9 +82,10 @@
     @Test
     public void testReadHeartRateVariabilityRmssdRecord_usingIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(
-                        getCompleteHeartRateVariabilityRmssdRecord(),
-                        getCompleteHeartRateVariabilityRmssdRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                getCompleteHeartRateVariabilityRmssdRecord(),
+                                getCompleteHeartRateVariabilityRmssdRecord()));
         readHeartRateVariabilityRmssdRecordUsingIds(recordList);
     }
 
@@ -128,8 +129,10 @@
                         new ReadRecordsRequestUsingFilters.Builder<>(
                                         HeartRateVariabilityRmssdRecord.class)
                                 .build());
-        HeartRateVariabilityRmssdRecord testRecord = getCompleteHeartRateVariabilityRmssdRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeartRateVariabilityRmssdRecord testRecord =
+                (HeartRateVariabilityRmssdRecord)
+                        TestUtils.insertRecord(getCompleteHeartRateVariabilityRmssdRecord());
         List<HeartRateVariabilityRmssdRecord> newHeartRateVariabilityRmssdRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -152,8 +155,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        HeartRateVariabilityRmssdRecord testRecord = getCompleteHeartRateVariabilityRmssdRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeartRateVariabilityRmssdRecord testRecord =
+                (HeartRateVariabilityRmssdRecord)
+                        TestUtils.insertRecord(getCompleteHeartRateVariabilityRmssdRecord());
         List<HeartRateVariabilityRmssdRecord> newHeartRateVariabilityRmssdRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -181,8 +186,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        HeartRateVariabilityRmssdRecord testRecord = getCompleteHeartRateVariabilityRmssdRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeartRateVariabilityRmssdRecord testRecord =
+                (HeartRateVariabilityRmssdRecord)
+                        TestUtils.insertRecord(getCompleteHeartRateVariabilityRmssdRecord());
         List<HeartRateVariabilityRmssdRecord> newHeartRateVariabilityRmssdRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -245,10 +252,10 @@
     public void testDeleteHeartRateVariabilityRmssdRecord_recordId_filters()
             throws InterruptedException {
         List<Record> records =
-                List.of(
-                        getBaseHeartRateVariabilityRmssdRecord(),
-                        getCompleteHeartRateVariabilityRmssdRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseHeartRateVariabilityRmssdRecord(),
+                                getCompleteHeartRateVariabilityRmssdRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -291,14 +298,14 @@
                 List.of(
                         getBaseHeartRateVariabilityRmssdRecord(),
                         getCompleteHeartRateVariabilityRmssdRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> insertedRecords = TestUtils.insertRecords(records);
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : insertedRecords) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
         TestUtils.verifyDeleteRecords(recordIds);
-        for (Record record : records) {
+        for (Record record : insertedRecords) {
             TestUtils.assertRecordNotFound(record.getMetadata().getId(), record.getClass());
         }
     }
@@ -505,8 +512,9 @@
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
         List<Record> testRecord =
-                Collections.singletonList(getCompleteHeartRateVariabilityRmssdRecord());
-        TestUtils.insertRecords(testRecord);
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteHeartRateVariabilityRmssdRecord()));
+
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -538,9 +546,8 @@
         assertThat(result).containsExactlyElementsIn(insertedRecord);
     }
 
-    private void readHeartRateVariabilityRmssdRecordUsingIds(List<Record> recordList)
+    private void readHeartRateVariabilityRmssdRecordUsingIds(List<Record> insertedRecords)
             throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
         ReadRecordsRequestUsingIds.Builder<HeartRateVariabilityRmssdRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(HeartRateVariabilityRmssdRecord.class);
         for (Record record : insertedRecords) {
@@ -552,7 +559,7 @@
         assertThat(requestUsingIds.getRecordIdFilters()).isNotNull();
         List<HeartRateVariabilityRmssdRecord> result = TestUtils.readRecords(requestUsingIds);
         assertThat(result).hasSize(insertedRecords.size());
-        assertThat(result).containsExactlyElementsIn(recordList);
+        assertThat(result).containsExactlyElementsIn(insertedRecords);
     }
 
     HeartRateVariabilityRmssdRecord getHeartRateVariabilityRmssdRecord_update(
diff --git a/tests/cts/src/android/healthconnect/cts/HeightRecordTest.java b/tests/cts/src/android/healthconnect/cts/HeightRecordTest.java
index 5022b9c..70e39e2 100644
--- a/tests/cts/src/android/healthconnect/cts/HeightRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/HeightRecordTest.java
@@ -133,8 +133,8 @@
         List<HeightRecord> oldHeightRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HeightRecord.class).build());
-        HeightRecord testRecord = getCompleteHeightRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeightRecord testRecord = (HeightRecord) TestUtils.insertRecord(getCompleteHeightRecord());
         List<HeightRecord> newHeightRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HeightRecord.class).build());
@@ -149,8 +149,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        HeightRecord testRecord = getCompleteHeightRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeightRecord testRecord = (HeightRecord) TestUtils.insertRecord(getCompleteHeightRecord());
         List<HeightRecord> newHeightRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HeightRecord.class)
@@ -171,8 +171,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        HeightRecord testRecord = getCompleteHeightRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HeightRecord testRecord = (HeightRecord) TestUtils.insertRecord(getCompleteHeightRecord());
         List<HeightRecord> newHeightRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HeightRecord.class)
@@ -251,8 +251,8 @@
 
     @Test
     public void testDeleteHeightRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseHeightRecord(), getCompleteHeightRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBaseHeightRecord(), getCompleteHeightRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -289,10 +289,10 @@
 
     @Test
     public void testDeleteHeightRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseHeightRecord(), getCompleteHeightRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBaseHeightRecord(), getCompleteHeightRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -496,8 +496,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteHeightRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteHeightRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/HydrationRecordTest.java b/tests/cts/src/android/healthconnect/cts/HydrationRecordTest.java
index 28b1b65..d72d9f2 100644
--- a/tests/cts/src/android/healthconnect/cts/HydrationRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/HydrationRecordTest.java
@@ -130,8 +130,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HydrationRecord.class)
                                 .build());
-        HydrationRecord testRecord = getCompleteHydrationRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HydrationRecord testRecord =
+                (HydrationRecord) TestUtils.insertRecord(getCompleteHydrationRecord());
         List<HydrationRecord> newHydrationRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HydrationRecord.class)
@@ -148,8 +149,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        HydrationRecord testRecord = getCompleteHydrationRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HydrationRecord testRecord =
+                (HydrationRecord) TestUtils.insertRecord(getCompleteHydrationRecord());
         List<HydrationRecord> newHydrationRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HydrationRecord.class)
@@ -172,8 +174,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        HydrationRecord testRecord = getCompleteHydrationRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        HydrationRecord testRecord =
+                (HydrationRecord) TestUtils.insertRecord(getCompleteHydrationRecord());
         List<HydrationRecord> newHydrationRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(HydrationRecord.class)
@@ -226,8 +229,9 @@
 
     @Test
     public void testDeleteHydrationRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseHydrationRecord(), getCompleteHydrationRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseHydrationRecord(), getCompleteHydrationRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -265,10 +269,11 @@
 
     @Test
     public void testDeleteHydrationRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseHydrationRecord(), getCompleteHydrationRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseHydrationRecord(), getCompleteHydrationRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -484,8 +489,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteHydrationRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteHydrationRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/IntermenstrualBleedingRecordTest.java b/tests/cts/src/android/healthconnect/cts/IntermenstrualBleedingRecordTest.java
index f706f88..404aea8 100644
--- a/tests/cts/src/android/healthconnect/cts/IntermenstrualBleedingRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/IntermenstrualBleedingRecordTest.java
@@ -82,9 +82,10 @@
     @Test
     public void testReadIntermenstrualBleedingRecord_usingIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(
-                        getCompleteIntermenstrualBleedingRecord(),
-                        getCompleteIntermenstrualBleedingRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                getCompleteIntermenstrualBleedingRecord(),
+                                getCompleteIntermenstrualBleedingRecord()));
         readIntermenstrualBleedingRecordUsingIds(recordList);
     }
 
@@ -128,8 +129,10 @@
                         new ReadRecordsRequestUsingFilters.Builder<>(
                                         IntermenstrualBleedingRecord.class)
                                 .build());
-        IntermenstrualBleedingRecord testRecord = getCompleteIntermenstrualBleedingRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        IntermenstrualBleedingRecord testRecord =
+                (IntermenstrualBleedingRecord)
+                        TestUtils.insertRecord(getCompleteIntermenstrualBleedingRecord());
         List<IntermenstrualBleedingRecord> newIntermenstrualBleedingRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -152,8 +155,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        IntermenstrualBleedingRecord testRecord = getCompleteIntermenstrualBleedingRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        IntermenstrualBleedingRecord testRecord =
+                (IntermenstrualBleedingRecord)
+                        TestUtils.insertRecord(getCompleteIntermenstrualBleedingRecord());
         List<IntermenstrualBleedingRecord> newIntermenstrualBleedingRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -181,8 +186,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        IntermenstrualBleedingRecord testRecord = getCompleteIntermenstrualBleedingRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        IntermenstrualBleedingRecord testRecord =
+                (IntermenstrualBleedingRecord)
+                        TestUtils.insertRecord(getCompleteIntermenstrualBleedingRecord());
         List<IntermenstrualBleedingRecord> newIntermenstrualBleedingRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -243,10 +250,10 @@
     public void testDeleteIntermenstrualBleedingRecord_recordId_filters()
             throws InterruptedException {
         List<Record> records =
-                List.of(
-                        getBaseIntermenstrualBleedingRecord(),
-                        getCompleteIntermenstrualBleedingRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseIntermenstrualBleedingRecord(),
+                                getCompleteIntermenstrualBleedingRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -286,12 +293,12 @@
     @Test
     public void testDeleteIntermenstrualBleedingRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(
-                        getBaseIntermenstrualBleedingRecord(),
-                        getCompleteIntermenstrualBleedingRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseIntermenstrualBleedingRecord(),
+                                getCompleteIntermenstrualBleedingRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -384,8 +391,8 @@
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
         List<Record> testRecord =
-                Collections.singletonList(getCompleteIntermenstrualBleedingRecord());
-        TestUtils.insertRecords(testRecord);
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteIntermenstrualBleedingRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -528,9 +535,8 @@
         readIntermenstrualBleedingRecordUsingIds(insertedRecords);
     }
 
-    private void readIntermenstrualBleedingRecordUsingIds(List<Record> recordList)
+    private void readIntermenstrualBleedingRecordUsingIds(List<Record> insertedRecords)
             throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
         ReadRecordsRequestUsingIds.Builder<IntermenstrualBleedingRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(IntermenstrualBleedingRecord.class);
         for (Record record : insertedRecords) {
@@ -541,7 +547,7 @@
         assertThat(requestUsingIds.getRecordIdFilters()).isNotNull();
         List<IntermenstrualBleedingRecord> result = TestUtils.readRecords(requestUsingIds);
         assertThat(result).hasSize(insertedRecords.size());
-        assertThat(result).containsExactlyElementsIn(recordList);
+        assertThat(result).containsExactlyElementsIn(insertedRecords);
     }
 
     IntermenstrualBleedingRecord getIntermenstrualBleedingRecord_update(
diff --git a/tests/cts/src/android/healthconnect/cts/LeanBodyMassRecordTest.java b/tests/cts/src/android/healthconnect/cts/LeanBodyMassRecordTest.java
index cde7e32..c09ef6f 100644
--- a/tests/cts/src/android/healthconnect/cts/LeanBodyMassRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/LeanBodyMassRecordTest.java
@@ -119,8 +119,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(LeanBodyMassRecord.class)
                                 .build());
-        LeanBodyMassRecord testRecord = getCompleteLeanBodyMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        LeanBodyMassRecord testRecord =
+                (LeanBodyMassRecord) TestUtils.insertRecord(getCompleteLeanBodyMassRecord());
         List<LeanBodyMassRecord> newLeanBodyMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(LeanBodyMassRecord.class)
@@ -137,8 +138,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        LeanBodyMassRecord testRecord = getCompleteLeanBodyMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        LeanBodyMassRecord testRecord =
+                (LeanBodyMassRecord) TestUtils.insertRecord(getCompleteLeanBodyMassRecord());
         List<LeanBodyMassRecord> newLeanBodyMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(LeanBodyMassRecord.class)
@@ -161,8 +163,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        LeanBodyMassRecord testRecord = getCompleteLeanBodyMassRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        LeanBodyMassRecord testRecord =
+                (LeanBodyMassRecord) TestUtils.insertRecord(getCompleteLeanBodyMassRecord());
         List<LeanBodyMassRecord> newLeanBodyMassRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(LeanBodyMassRecord.class)
@@ -244,8 +247,8 @@
     @Test
     public void testDeleteLeanBodyMassRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseLeanBodyMassRecord(), getCompleteLeanBodyMassRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseLeanBodyMassRecord(), getCompleteLeanBodyMassRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -284,10 +287,10 @@
     @Test
     public void testDeleteLeanBodyMassRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseLeanBodyMassRecord(), getCompleteLeanBodyMassRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseLeanBodyMassRecord(), getCompleteLeanBodyMassRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -461,8 +464,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteLeanBodyMassRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteLeanBodyMassRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/MenstruationFlowRecordTest.java b/tests/cts/src/android/healthconnect/cts/MenstruationFlowRecordTest.java
index f48a814..5e6e942 100644
--- a/tests/cts/src/android/healthconnect/cts/MenstruationFlowRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/MenstruationFlowRecordTest.java
@@ -121,8 +121,10 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(MenstruationFlowRecord.class)
                                 .build());
-        MenstruationFlowRecord testRecord = getCompleteMenstruationFlowRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        MenstruationFlowRecord testRecord =
+                (MenstruationFlowRecord)
+                        TestUtils.insertRecord(getCompleteMenstruationFlowRecord());
         List<MenstruationFlowRecord> newMenstruationFlowRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(MenstruationFlowRecord.class)
@@ -144,8 +146,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        MenstruationFlowRecord testRecord = getCompleteMenstruationFlowRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        MenstruationFlowRecord testRecord =
+                (MenstruationFlowRecord)
+                        TestUtils.insertRecord(getCompleteMenstruationFlowRecord());
         List<MenstruationFlowRecord> newMenstruationFlowRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(MenstruationFlowRecord.class)
@@ -171,8 +175,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        MenstruationFlowRecord testRecord = getCompleteMenstruationFlowRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        MenstruationFlowRecord testRecord =
+                (MenstruationFlowRecord)
+                        TestUtils.insertRecord(getCompleteMenstruationFlowRecord());
         List<MenstruationFlowRecord> newMenstruationFlowRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(MenstruationFlowRecord.class)
@@ -255,8 +261,10 @@
     @Test
     public void testDeleteMenstruationFlowRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseMenstruationFlowRecord(), getCompleteMenstruationFlowRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseMenstruationFlowRecord(),
+                                getCompleteMenstruationFlowRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -295,10 +303,12 @@
     @Test
     public void testDeleteMenstruationFlowRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseMenstruationFlowRecord(), getCompleteMenstruationFlowRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseMenstruationFlowRecord(),
+                                getCompleteMenstruationFlowRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -471,8 +481,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteMenstruationFlowRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteMenstruationFlowRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/MenstruationPeriodRecordTest.java b/tests/cts/src/android/healthconnect/cts/MenstruationPeriodRecordTest.java
index f87fd26..e32eca5 100644
--- a/tests/cts/src/android/healthconnect/cts/MenstruationPeriodRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/MenstruationPeriodRecordTest.java
@@ -81,9 +81,10 @@
     @Test
     public void testReadMenstruationPeriodRecord_usingIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(
-                        getCompleteMenstruationPeriodRecord(),
-                        getCompleteMenstruationPeriodRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                getCompleteMenstruationPeriodRecord(),
+                                getCompleteMenstruationPeriodRecord()));
         readMenstruationPeriodRecordUsingIds(recordList);
     }
 
@@ -125,8 +126,10 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(MenstruationPeriodRecord.class)
                                 .build());
-        MenstruationPeriodRecord testRecord = getCompleteMenstruationPeriodRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        MenstruationPeriodRecord testRecord =
+                (MenstruationPeriodRecord)
+                        TestUtils.insertRecord(getCompleteMenstruationPeriodRecord());
         List<MenstruationPeriodRecord> newMenstruationPeriodRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(MenstruationPeriodRecord.class)
@@ -148,8 +151,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        MenstruationPeriodRecord testRecord = getCompleteMenstruationPeriodRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        MenstruationPeriodRecord testRecord =
+                (MenstruationPeriodRecord)
+                        TestUtils.insertRecord(getCompleteMenstruationPeriodRecord());
         List<MenstruationPeriodRecord> newMenstruationPeriodRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(MenstruationPeriodRecord.class)
@@ -175,8 +180,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        MenstruationPeriodRecord testRecord = getCompleteMenstruationPeriodRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        MenstruationPeriodRecord testRecord =
+                (MenstruationPeriodRecord)
+                        TestUtils.insertRecord(getCompleteMenstruationPeriodRecord());
         List<MenstruationPeriodRecord> newMenstruationPeriodRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(MenstruationPeriodRecord.class)
@@ -231,8 +238,10 @@
     @Test
     public void testDeleteMenstruationPeriodRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseMenstruationPeriodRecord(), getCompleteMenstruationPeriodRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseMenstruationPeriodRecord(),
+                                getCompleteMenstruationPeriodRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -272,10 +281,12 @@
     @Test
     public void testDeleteMenstruationPeriodRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseMenstruationPeriodRecord(), getCompleteMenstruationPeriodRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseMenstruationPeriodRecord(),
+                                getCompleteMenstruationPeriodRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -492,8 +503,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteMenstruationPeriodRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteMenstruationPeriodRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -525,9 +537,8 @@
         assertThat(result).containsExactlyElementsIn(insertedRecord);
     }
 
-    private void readMenstruationPeriodRecordUsingIds(List<Record> recordList)
+    private void readMenstruationPeriodRecordUsingIds(List<Record> insertedRecords)
             throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
         ReadRecordsRequestUsingIds.Builder<MenstruationPeriodRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(MenstruationPeriodRecord.class);
         for (Record record : insertedRecords) {
@@ -538,7 +549,7 @@
         assertThat(requestUsingIds.getRecordIdFilters()).isNotNull();
         List<MenstruationPeriodRecord> result = TestUtils.readRecords(requestUsingIds);
         assertThat(result).hasSize(insertedRecords.size());
-        assertThat(result).containsExactlyElementsIn(recordList);
+        assertThat(result).containsExactlyElementsIn(insertedRecords);
     }
 
     MenstruationPeriodRecord getMenstruationPeriodRecord_update(
diff --git a/tests/cts/src/android/healthconnect/cts/NutritionRecordTest.java b/tests/cts/src/android/healthconnect/cts/NutritionRecordTest.java
index 0c3848f..0203408 100644
--- a/tests/cts/src/android/healthconnect/cts/NutritionRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/NutritionRecordTest.java
@@ -217,8 +217,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(NutritionRecord.class)
                                 .build());
-        NutritionRecord testRecord = getCompleteNutritionRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        NutritionRecord testRecord =
+                (NutritionRecord) TestUtils.insertRecord(getCompleteNutritionRecord());
         List<NutritionRecord> newNutritionRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(NutritionRecord.class)
@@ -235,8 +236,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        NutritionRecord testRecord = getCompleteNutritionRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        NutritionRecord testRecord =
+                (NutritionRecord) TestUtils.insertRecord(getCompleteNutritionRecord());
         List<NutritionRecord> newNutritionRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(NutritionRecord.class)
@@ -259,8 +261,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        NutritionRecord testRecord = getCompleteNutritionRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        NutritionRecord testRecord =
+                (NutritionRecord) TestUtils.insertRecord(getCompleteNutritionRecord());
         List<NutritionRecord> newNutritionRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(NutritionRecord.class)
@@ -357,8 +360,9 @@
 
     @Test
     public void testDeleteNutritionRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseNutritionRecord(), getCompleteNutritionRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseNutritionRecord(), getCompleteNutritionRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -404,7 +408,7 @@
         }
 
         TestUtils.verifyDeleteRecords(recordIds);
-        for (Record record : records) {
+        for (Record record : insertedRecord) {
             TestUtils.assertRecordNotFound(record.getMetadata().getId(), record.getClass());
         }
     }
@@ -734,8 +738,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteNutritionRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteNutritionRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/OvulationTestRecordTest.java b/tests/cts/src/android/healthconnect/cts/OvulationTestRecordTest.java
index 4d08043..8ade6f7 100644
--- a/tests/cts/src/android/healthconnect/cts/OvulationTestRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/OvulationTestRecordTest.java
@@ -118,8 +118,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(OvulationTestRecord.class)
                                 .build());
-        OvulationTestRecord testRecord = getCompleteOvulationTestRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        OvulationTestRecord testRecord =
+                (OvulationTestRecord) TestUtils.insertRecord(getCompleteOvulationTestRecord());
         List<OvulationTestRecord> newOvulationTestRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(OvulationTestRecord.class)
@@ -139,8 +140,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        OvulationTestRecord testRecord = getCompleteOvulationTestRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        OvulationTestRecord testRecord =
+                (OvulationTestRecord) TestUtils.insertRecord(getCompleteOvulationTestRecord());
         List<OvulationTestRecord> newOvulationTestRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(OvulationTestRecord.class)
@@ -166,8 +167,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        OvulationTestRecord testRecord = getCompleteOvulationTestRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+        OvulationTestRecord testRecord =
+                (OvulationTestRecord) TestUtils.insertRecord(getCompleteOvulationTestRecord());
         List<OvulationTestRecord> newOvulationTestRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(OvulationTestRecord.class)
@@ -249,8 +250,8 @@
     @Test
     public void testDeleteOvulationTestRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseOvulationTestRecord(), getCompleteOvulationTestRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseOvulationTestRecord(), getCompleteOvulationTestRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -297,7 +298,7 @@
         }
 
         TestUtils.verifyDeleteRecords(recordIds);
-        for (Record record : records) {
+        for (Record record : insertedRecord) {
             TestUtils.assertRecordNotFound(record.getMetadata().getId(), record.getClass());
         }
     }
@@ -461,8 +462,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteOvulationTestRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteOvulationTestRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/OxygenSaturationRecordTest.java b/tests/cts/src/android/healthconnect/cts/OxygenSaturationRecordTest.java
index 559e518..debfab6 100644
--- a/tests/cts/src/android/healthconnect/cts/OxygenSaturationRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/OxygenSaturationRecordTest.java
@@ -122,8 +122,10 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(OxygenSaturationRecord.class)
                                 .build());
-        OxygenSaturationRecord testRecord = getCompleteOxygenSaturationRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        OxygenSaturationRecord testRecord =
+                (OxygenSaturationRecord)
+                        TestUtils.insertRecord(getCompleteOxygenSaturationRecord());
         List<OxygenSaturationRecord> newOxygenSaturationRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(OxygenSaturationRecord.class)
@@ -145,8 +147,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        OxygenSaturationRecord testRecord = getCompleteOxygenSaturationRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        OxygenSaturationRecord testRecord =
+                (OxygenSaturationRecord)
+                        TestUtils.insertRecord(getCompleteOxygenSaturationRecord());
         List<OxygenSaturationRecord> newOxygenSaturationRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(OxygenSaturationRecord.class)
@@ -172,8 +176,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        OxygenSaturationRecord testRecord = getCompleteOxygenSaturationRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        OxygenSaturationRecord testRecord =
+                (OxygenSaturationRecord)
+                        TestUtils.insertRecord(getCompleteOxygenSaturationRecord());
         List<OxygenSaturationRecord> newOxygenSaturationRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(OxygenSaturationRecord.class)
@@ -256,8 +262,10 @@
     @Test
     public void testDeleteOxygenSaturationRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseOxygenSaturationRecord(), getCompleteOxygenSaturationRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseOxygenSaturationRecord(),
+                                getCompleteOxygenSaturationRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -296,10 +304,12 @@
     @Test
     public void testDeleteOxygenSaturationRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseOxygenSaturationRecord(), getCompleteOxygenSaturationRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseOxygenSaturationRecord(),
+                                getCompleteOxygenSaturationRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -479,8 +489,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteOxygenSaturationRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> insertedRecords =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteOxygenSaturationRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -489,7 +500,10 @@
                                 .map(Metadata::getId)
                                 .toList())
                 .containsExactlyElementsIn(
-                        testRecord.stream().map(Record::getMetadata).map(Metadata::getId).toList());
+                        insertedRecords.stream()
+                                .map(Record::getMetadata)
+                                .map(Metadata::getId)
+                                .toList());
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
         TestUtils.verifyDeleteRecords(
diff --git a/tests/cts/src/android/healthconnect/cts/PowerRecordTest.java b/tests/cts/src/android/healthconnect/cts/PowerRecordTest.java
index e75f7be..65eeb61 100644
--- a/tests/cts/src/android/healthconnect/cts/PowerRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/PowerRecordTest.java
@@ -128,8 +128,8 @@
         List<PowerRecord> oldPowerRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(PowerRecord.class).build());
-        PowerRecord testRecord = getCompletePowerRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        PowerRecord testRecord = (PowerRecord) TestUtils.insertRecord(getCompletePowerRecord());
         List<PowerRecord> newPowerRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(PowerRecord.class).build());
@@ -144,8 +144,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        PowerRecord testRecord = getCompletePowerRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        PowerRecord testRecord = (PowerRecord) TestUtils.insertRecord(getCompletePowerRecord());
         List<PowerRecord> newPowerRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(PowerRecord.class)
@@ -165,8 +165,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        PowerRecord testRecord = getCompletePowerRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        PowerRecord testRecord = (PowerRecord) TestUtils.insertRecord(getCompletePowerRecord());
         List<PowerRecord> newPowerRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(PowerRecord.class)
@@ -224,8 +224,8 @@
 
     @Test
     public void testDeletePowerRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBasePowerRecord(), getCompletePowerRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBasePowerRecord(), getCompletePowerRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -262,10 +262,10 @@
 
     @Test
     public void testDeletePowerRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBasePowerRecord(), getCompletePowerRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBasePowerRecord(), getCompletePowerRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -476,8 +476,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompletePowerRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompletePowerRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -496,7 +496,9 @@
     }
 
     private void testReadPowerRecordIds() throws InterruptedException {
-        List<Record> recordList = Arrays.asList(getCompletePowerRecord(), getCompletePowerRecord());
+        List<Record> recordList =
+                TestUtils.insertRecords(
+                        Arrays.asList(getCompletePowerRecord(), getCompletePowerRecord()));
         readPowerRecordUsingIds(recordList);
     }
 
@@ -512,8 +514,7 @@
         assertThat(result).containsExactlyElementsIn(insertedRecord);
     }
 
-    private void readPowerRecordUsingIds(List<Record> recordList) throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
+    private void readPowerRecordUsingIds(List<Record> insertedRecords) throws InterruptedException {
         ReadRecordsRequestUsingIds.Builder<PowerRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(PowerRecord.class);
         for (Record record : insertedRecords) {
diff --git a/tests/cts/src/android/healthconnect/cts/RespiratoryRateRecordTest.java b/tests/cts/src/android/healthconnect/cts/RespiratoryRateRecordTest.java
index e816d51..72b16ae 100644
--- a/tests/cts/src/android/healthconnect/cts/RespiratoryRateRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/RespiratoryRateRecordTest.java
@@ -120,8 +120,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(RespiratoryRateRecord.class)
                                 .build());
-        RespiratoryRateRecord testRecord = getCompleteRespiratoryRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        RespiratoryRateRecord testRecord =
+                (RespiratoryRateRecord) TestUtils.insertRecord(getCompleteRespiratoryRateRecord());
         List<RespiratoryRateRecord> newRespiratoryRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(RespiratoryRateRecord.class)
@@ -142,8 +143,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        RespiratoryRateRecord testRecord = getCompleteRespiratoryRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        RespiratoryRateRecord testRecord =
+                (RespiratoryRateRecord) TestUtils.insertRecord(getCompleteRespiratoryRateRecord());
         List<RespiratoryRateRecord> newRespiratoryRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(RespiratoryRateRecord.class)
@@ -169,8 +171,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        RespiratoryRateRecord testRecord = getCompleteRespiratoryRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        RespiratoryRateRecord testRecord =
+                (RespiratoryRateRecord) TestUtils.insertRecord(getCompleteRespiratoryRateRecord());
         List<RespiratoryRateRecord> newRespiratoryRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(RespiratoryRateRecord.class)
@@ -253,8 +256,10 @@
     @Test
     public void testDeleteRespiratoryRateRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseRespiratoryRateRecord(), getCompleteRespiratoryRateRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseRespiratoryRateRecord(),
+                                getCompleteRespiratoryRateRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -293,10 +298,12 @@
     @Test
     public void testDeleteRespiratoryRateRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseRespiratoryRateRecord(), getCompleteRespiratoryRateRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseRespiratoryRateRecord(),
+                                getCompleteRespiratoryRateRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -475,8 +482,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteRespiratoryRateRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteRespiratoryRateRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/RestingHeartRateRecordTest.java b/tests/cts/src/android/healthconnect/cts/RestingHeartRateRecordTest.java
index dbfc425..1b9546b 100644
--- a/tests/cts/src/android/healthconnect/cts/RestingHeartRateRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/RestingHeartRateRecordTest.java
@@ -133,8 +133,10 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(RestingHeartRateRecord.class)
                                 .build());
-        RestingHeartRateRecord testRecord = getCompleteRestingHeartRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        RestingHeartRateRecord testRecord =
+                (RestingHeartRateRecord)
+                        TestUtils.insertRecord(getCompleteRestingHeartRateRecord());
         List<RestingHeartRateRecord> newRestingHeartRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(RestingHeartRateRecord.class)
@@ -156,8 +158,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        RestingHeartRateRecord testRecord = getCompleteRestingHeartRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        RestingHeartRateRecord testRecord =
+                (RestingHeartRateRecord)
+                        TestUtils.insertRecord(getCompleteRestingHeartRateRecord());
         List<RestingHeartRateRecord> newRestingHeartRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(RestingHeartRateRecord.class)
@@ -183,8 +187,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        RestingHeartRateRecord testRecord = getCompleteRestingHeartRateRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        RestingHeartRateRecord testRecord =
+                (RestingHeartRateRecord)
+                        TestUtils.insertRecord(getCompleteRestingHeartRateRecord());
         List<RestingHeartRateRecord> newRestingHeartRateRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(RestingHeartRateRecord.class)
@@ -267,8 +273,10 @@
     @Test
     public void testDeleteRestingHeartRateRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseRestingHeartRateRecord(), getCompleteRestingHeartRateRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseRestingHeartRateRecord(),
+                                getCompleteRestingHeartRateRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -307,10 +315,12 @@
     @Test
     public void testDeleteRestingHeartRateRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseRestingHeartRateRecord(), getCompleteRestingHeartRateRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(
+                                getBaseRestingHeartRateRecord(),
+                                getCompleteRestingHeartRateRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -535,7 +545,7 @@
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
         List<Record> testRecord = Collections.singletonList(getCompleteRestingHeartRateRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> insertedRecords = TestUtils.insertRecords(testRecord);
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -544,7 +554,10 @@
                                 .map(Metadata::getId)
                                 .toList())
                 .containsExactlyElementsIn(
-                        testRecord.stream().map(Record::getMetadata).map(Metadata::getId).toList());
+                        insertedRecords.stream()
+                                .map(Record::getMetadata)
+                                .map(Metadata::getId)
+                                .toList());
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
         TestUtils.verifyDeleteRecords(
diff --git a/tests/cts/src/android/healthconnect/cts/SessionDatatypeDisabledFeatureTest.java b/tests/cts/src/android/healthconnect/cts/SessionDatatypeDisabledFeatureTest.java
index cfe1f15..d736c90 100644
--- a/tests/cts/src/android/healthconnect/cts/SessionDatatypeDisabledFeatureTest.java
+++ b/tests/cts/src/android/healthconnect/cts/SessionDatatypeDisabledFeatureTest.java
@@ -74,11 +74,11 @@
     public void testReadExerciseSession_insertAndRead_sessionIsNotAvailable()
             throws InterruptedException {
         List<Record> records = List.of(TestUtils.buildExerciseSession());
-        TestUtils.insertRecords(records);
+        List<Record> insertedRecords = TestUtils.insertRecords(records);
         setSessionDatatypesFeatureEnabledFlag(false);
         ReadRecordsRequestUsingIds.Builder<ExerciseSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(ExerciseSessionRecord.class);
-        request.addId(records.get(0).getMetadata().getId());
+        request.addId(insertedRecords.get(0).getMetadata().getId());
         List<ExerciseSessionRecord> readRecords = TestUtils.readRecords(request.build());
         assertThat(readRecords).isEmpty();
     }
@@ -101,12 +101,12 @@
     public void testReadSleepSession_insertAndRead_sessionIsNotAvailable()
             throws InterruptedException {
         List<Record> records = List.of(TestUtils.buildSleepSession());
-        TestUtils.insertRecords(records);
+        List<Record> insertedRecords = TestUtils.insertRecords(records);
         setSessionDatatypesFeatureEnabledFlag(false);
 
         ReadRecordsRequestUsingIds.Builder<SleepSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(SleepSessionRecord.class);
-        request.addId(records.get(0).getMetadata().getId());
+        request.addId(insertedRecords.get(0).getMetadata().getId());
         List<SleepSessionRecord> readRecords = TestUtils.readRecords(request.build());
         assertThat(readRecords).isEmpty();
     }
diff --git a/tests/cts/src/android/healthconnect/cts/SexualActivityRecordTest.java b/tests/cts/src/android/healthconnect/cts/SexualActivityRecordTest.java
index 50cc1c6..73d2f50 100644
--- a/tests/cts/src/android/healthconnect/cts/SexualActivityRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/SexualActivityRecordTest.java
@@ -118,8 +118,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SexualActivityRecord.class)
                                 .build());
-        SexualActivityRecord testRecord = getCompleteSexualActivityRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        SexualActivityRecord testRecord =
+                (SexualActivityRecord) TestUtils.insertRecord(getCompleteSexualActivityRecord());
         List<SexualActivityRecord> newSexualActivityRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SexualActivityRecord.class)
@@ -139,8 +140,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        SexualActivityRecord testRecord = getCompleteSexualActivityRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        SexualActivityRecord testRecord =
+                (SexualActivityRecord) TestUtils.insertRecord(getCompleteSexualActivityRecord());
         List<SexualActivityRecord> newSexualActivityRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SexualActivityRecord.class)
@@ -166,8 +168,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        SexualActivityRecord testRecord = getCompleteSexualActivityRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        SexualActivityRecord testRecord =
+                (SexualActivityRecord) TestUtils.insertRecord(getCompleteSexualActivityRecord());
         List<SexualActivityRecord> newSexualActivityRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SexualActivityRecord.class)
@@ -249,8 +252,8 @@
     @Test
     public void testDeleteSexualActivityRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseSexualActivityRecord(), getCompleteSexualActivityRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseSexualActivityRecord(), getCompleteSexualActivityRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -289,10 +292,10 @@
     @Test
     public void testDeleteSexualActivityRecord_usingIds() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseSexualActivityRecord(), getCompleteSexualActivityRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseSexualActivityRecord(), getCompleteSexualActivityRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -461,8 +464,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteSexualActivityRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteSexualActivityRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/SleepSessionRecordTest.java b/tests/cts/src/android/healthconnect/cts/SleepSessionRecordTest.java
index 3bd0a15..46b52a6 100644
--- a/tests/cts/src/android/healthconnect/cts/SleepSessionRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/SleepSessionRecordTest.java
@@ -216,15 +216,14 @@
 
     @Test
     public void testReadById_insertAndReadByIdOne_recordsAreEqual() throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildSleepSession());
-        TestUtils.insertRecords(records);
+        SleepSessionRecord insertedRecord =
+                (SleepSessionRecord) TestUtils.insertRecord(TestUtils.buildSleepSession());
 
         ReadRecordsRequestUsingIds.Builder<SleepSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(SleepSessionRecord.class);
-        request.addId(records.get(0).getMetadata().getId());
+        request.addId(insertedRecord.getMetadata().getId());
 
         SleepSessionRecord readRecord = TestUtils.readRecords(request.build()).get(0);
-        SleepSessionRecord insertedRecord = (SleepSessionRecord) records.get(0);
         assertThat(readRecord.getMetadata()).isEqualTo(insertedRecord.getMetadata());
         assertThat(CharSequence.compare(readRecord.getTitle(), insertedRecord.getTitle()))
                 .isEqualTo(0);
@@ -236,8 +235,9 @@
 
     @Test
     public void testReadById_insertAndReadById_recordsAreEqual() throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildSleepSession(), buildSleepSessionMinimal());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(TestUtils.buildSleepSession(), buildSleepSessionMinimal()));
 
         ReadRecordsRequestUsingIds.Builder<SleepSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(SleepSessionRecord.class);
@@ -250,8 +250,9 @@
     @Test
     public void testReadByClientId_insertAndReadByClientId_recordsAreEqual()
             throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildSleepSession(), buildSleepSessionMinimal());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(TestUtils.buildSleepSession(), buildSleepSessionMinimal()));
 
         ReadRecordsRequestUsingIds.Builder<SleepSessionRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(SleepSessionRecord.class);
@@ -264,26 +265,28 @@
     @Test
     public void testReadByClientId_insertAndReadByDefaultFilter_filteredAll()
             throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildSleepSession(), buildSleepSessionMinimal());
-        TestUtils.insertRecords(records);
+        List<Record> insertedRecords =
+                TestUtils.insertRecords(
+                        List.of(TestUtils.buildSleepSession(), buildSleepSessionMinimal()));
 
         List<SleepSessionRecord> readRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SleepSessionRecord.class)
                                 .build());
-        assertRecordsAreEqual(records, readRecords);
+        assertRecordsAreEqual(insertedRecords, readRecords);
     }
 
     @Test
     public void testDeleteRecords_insertAndDeleteById_recordsNotFoundAnymore()
             throws InterruptedException {
-        List<Record> records = List.of(TestUtils.buildSleepSession(), buildSleepSessionMinimal());
-        List<Record> insertedRecords = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(TestUtils.buildSleepSession(), buildSleepSessionMinimal()));
 
         TestUtils.assertRecordFound(records.get(0).getMetadata().getId(), SleepSessionRecord.class);
         TestUtils.assertRecordFound(records.get(1).getMetadata().getId(), SleepSessionRecord.class);
 
-        TestUtils.deleteRecords(insertedRecords);
+        TestUtils.deleteRecords(records);
 
         TestUtils.assertRecordNotFound(
                 records.get(0).getMetadata().getId(), SleepSessionRecord.class);
@@ -424,8 +427,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(buildSleepSession());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(buildSleepSession()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/SpeedRecordTest.java b/tests/cts/src/android/healthconnect/cts/SpeedRecordTest.java
index 7677a42..27c3470 100644
--- a/tests/cts/src/android/healthconnect/cts/SpeedRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/SpeedRecordTest.java
@@ -95,7 +95,11 @@
 
     @Test
     public void testReadSpeedRecord_usingIds() throws InterruptedException {
-        testReadSpeedRecordIds();
+        List<Record> recordList =
+                TestUtils.insertRecords(
+                        Arrays.asList(getCompleteSpeedRecord(), getCompleteSpeedRecord()));
+
+        readSpeedRecordUsingIds(recordList);
     }
 
     @Test
@@ -130,8 +134,8 @@
         List<SpeedRecord> oldSpeedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SpeedRecord.class).build());
-        SpeedRecord testRecord = getCompleteSpeedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        SpeedRecord testRecord = (SpeedRecord) TestUtils.insertRecord(getCompleteSpeedRecord());
         List<SpeedRecord> newSpeedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SpeedRecord.class).build());
@@ -146,8 +150,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        SpeedRecord testRecord = getCompleteSpeedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        SpeedRecord testRecord = (SpeedRecord) TestUtils.insertRecord(getCompleteSpeedRecord());
         List<SpeedRecord> newSpeedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SpeedRecord.class)
@@ -168,8 +172,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        SpeedRecord testRecord = getCompleteSpeedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        SpeedRecord testRecord = (SpeedRecord) TestUtils.insertRecord(getCompleteSpeedRecord());
         List<SpeedRecord> newSpeedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(SpeedRecord.class)
@@ -227,8 +231,8 @@
 
     @Test
     public void testDeleteSpeedRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseSpeedRecord(), getCompleteSpeedRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBaseSpeedRecord(), getCompleteSpeedRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -265,10 +269,10 @@
 
     @Test
     public void testDeleteSpeedRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseSpeedRecord(), getCompleteSpeedRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBaseSpeedRecord(), getCompleteSpeedRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -331,8 +335,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteSpeedRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteSpeedRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -391,11 +395,6 @@
         }
     }
 
-    private void testReadSpeedRecordIds() throws InterruptedException {
-        List<Record> recordList = Arrays.asList(getCompleteSpeedRecord(), getCompleteSpeedRecord());
-        readSpeedRecordUsingIds(recordList);
-    }
-
     private void readSpeedRecordUsingClientId(List<Record> insertedRecord)
             throws InterruptedException {
         ReadRecordsRequestUsingIds.Builder<SpeedRecord> request =
diff --git a/tests/cts/src/android/healthconnect/cts/StepsCadenceRecordTest.java b/tests/cts/src/android/healthconnect/cts/StepsCadenceRecordTest.java
index 1465a94..8afe4e1 100644
--- a/tests/cts/src/android/healthconnect/cts/StepsCadenceRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/StepsCadenceRecordTest.java
@@ -133,8 +133,9 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsCadenceRecord.class)
                                 .build());
-        StepsCadenceRecord testRecord = getCompleteStepsCadenceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        StepsCadenceRecord testRecord =
+                (StepsCadenceRecord) TestUtils.insertRecord(getCompleteStepsCadenceRecord());
         List<StepsCadenceRecord> newStepsCadenceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsCadenceRecord.class)
@@ -151,8 +152,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        StepsCadenceRecord testRecord = getCompleteStepsCadenceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        StepsCadenceRecord testRecord =
+                (StepsCadenceRecord) TestUtils.insertRecord(getCompleteStepsCadenceRecord());
         List<StepsCadenceRecord> newStepsCadenceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsCadenceRecord.class)
@@ -175,8 +177,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        StepsCadenceRecord testRecord = getCompleteStepsCadenceRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        StepsCadenceRecord testRecord =
+                (StepsCadenceRecord) TestUtils.insertRecord(getCompleteStepsCadenceRecord());
         List<StepsCadenceRecord> newStepsCadenceRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsCadenceRecord.class)
@@ -238,8 +241,8 @@
     @Test
     public void testDeleteStepsCadenceRecord_recordId_filters() throws InterruptedException {
         List<Record> records =
-                List.of(getBaseStepsCadenceRecord(), getCompleteStepsCadenceRecord());
-        TestUtils.insertRecords(records);
+                TestUtils.insertRecords(
+                        List.of(getBaseStepsCadenceRecord(), getCompleteStepsCadenceRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -277,16 +280,16 @@
 
     @Test
     public void testDeleteStepsCadenceRecord_usingIds() throws InterruptedException {
-        List<Record> records =
-                List.of(getBaseStepsCadenceRecord(), getCompleteStepsCadenceRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
-        List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
+        List<Record> insertedRecord =
+                TestUtils.insertRecords(
+                        List.of(getBaseStepsCadenceRecord(), getCompleteStepsCadenceRecord()));
+        List<RecordIdFilter> recordIds = new ArrayList<>(insertedRecord.size());
         for (Record record : insertedRecord) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
         TestUtils.verifyDeleteRecords(recordIds);
-        for (Record record : records) {
+        for (Record record : insertedRecord) {
             TestUtils.assertRecordNotFound(record.getMetadata().getId(), record.getClass());
         }
     }
@@ -458,8 +461,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteStepsCadenceRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteStepsCadenceRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -481,7 +484,9 @@
 
     private void testReadStepsCadenceRecordIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(getCompleteStepsCadenceRecord(), getCompleteStepsCadenceRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                getCompleteStepsCadenceRecord(), getCompleteStepsCadenceRecord()));
         readStepsCadenceRecordUsingIds(recordList);
     }
 
@@ -497,9 +502,8 @@
         assertThat(result).containsExactlyElementsIn(insertedRecord);
     }
 
-    private void readStepsCadenceRecordUsingIds(List<Record> recordList)
+    private void readStepsCadenceRecordUsingIds(List<Record> insertedRecords)
             throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
         ReadRecordsRequestUsingIds.Builder<StepsCadenceRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(StepsCadenceRecord.class);
         for (Record record : insertedRecords) {
diff --git a/tests/cts/src/android/healthconnect/cts/StepsRecordTest.java b/tests/cts/src/android/healthconnect/cts/StepsRecordTest.java
index 7b6b40e..cdf3b04 100644
--- a/tests/cts/src/android/healthconnect/cts/StepsRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/StepsRecordTest.java
@@ -168,8 +168,9 @@
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsRecord.class)
                                 .setAscending(true)
                                 .build());
-        StepsRecord testRecord = TestUtils.getCompleteStepsRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        StepsRecord testRecord =
+                (StepsRecord) TestUtils.insertRecord(TestUtils.getCompleteStepsRecord());
         List<StepsRecord> newStepsRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsRecord.class)
@@ -186,8 +187,9 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        StepsRecord testRecord = TestUtils.getCompleteStepsRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        StepsRecord testRecord =
+                (StepsRecord) TestUtils.insertRecord(TestUtils.getCompleteStepsRecord());
         List<StepsRecord> newStepsRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsRecord.class)
@@ -219,8 +221,9 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        StepsRecord testRecord = TestUtils.getCompleteStepsRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        StepsRecord testRecord =
+                (StepsRecord) TestUtils.insertRecord(TestUtils.getCompleteStepsRecord());
         List<StepsRecord> newStepsRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsRecord.class)
@@ -250,9 +253,8 @@
 
     @Test
     public void testReadStepsRecordUsingFilters_withPageSize() throws InterruptedException {
-        List<Record> recordList =
-                Arrays.asList(getStepsRecord_minusDays(1), getStepsRecord_minusDays(2));
-        TestUtils.insertRecords(recordList);
+        TestUtils.insertRecords(
+                Arrays.asList(getStepsRecord_minusDays(1), getStepsRecord_minusDays(2)));
         ReadRecordsResponse<StepsRecord> response =
                 readRecordsWithPagination(
                         new ReadRecordsRequestUsingFilters.Builder<>(StepsRecord.class)
@@ -549,8 +551,9 @@
 
     @Test
     public void testDeleteStepsRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseStepsRecord(), TestUtils.getCompleteStepsRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseStepsRecord(), TestUtils.getCompleteStepsRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -587,10 +590,11 @@
 
     @Test
     public void testDeleteStepsRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseStepsRecord(), TestUtils.getCompleteStepsRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseStepsRecord(), TestUtils.getCompleteStepsRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
         for (RecordIdFilter recordIdFilter : recordIds) {
@@ -607,10 +611,11 @@
 
     @Test
     public void testDeleteStepsRecord_usingInvalidClientIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseStepsRecord(), TestUtils.getCompleteStepsRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(
+                        List.of(getBaseStepsRecord(), TestUtils.getCompleteStepsRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(
                     RecordIdFilter.fromClientRecordId(
                             record.getClass(), record.getMetadata().getId()));
@@ -1084,8 +1089,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(TestUtils.getCompleteStepsRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(TestUtils.getCompleteStepsRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/TotalCaloriesBurnedRecordTest.java b/tests/cts/src/android/healthconnect/cts/TotalCaloriesBurnedRecordTest.java
index 9d44665..61981e9 100644
--- a/tests/cts/src/android/healthconnect/cts/TotalCaloriesBurnedRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/TotalCaloriesBurnedRecordTest.java
@@ -93,9 +93,10 @@
     @Test
     public void testReadTotalCaloriesBurnedRecord_usingIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(
-                        getCompleteTotalCaloriesBurnedRecord(),
-                        getCompleteTotalCaloriesBurnedRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                getCompleteTotalCaloriesBurnedRecord(),
+                                getCompleteTotalCaloriesBurnedRecord()));
         readTotalCaloriesBurnedRecordUsingIds(recordList);
     }
 
@@ -139,8 +140,10 @@
                         new ReadRecordsRequestUsingFilters.Builder<>(
                                         TotalCaloriesBurnedRecord.class)
                                 .build());
-        TotalCaloriesBurnedRecord testRecord = getCompleteTotalCaloriesBurnedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        TotalCaloriesBurnedRecord testRecord =
+                (TotalCaloriesBurnedRecord)
+                        TestUtils.insertRecord(getCompleteTotalCaloriesBurnedRecord());
         List<TotalCaloriesBurnedRecord> newTotalCaloriesBurnedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -163,8 +166,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        TotalCaloriesBurnedRecord testRecord = getCompleteTotalCaloriesBurnedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        TotalCaloriesBurnedRecord testRecord =
+                (TotalCaloriesBurnedRecord)
+                        TestUtils.insertRecord(getCompleteTotalCaloriesBurnedRecord());
         List<TotalCaloriesBurnedRecord> newTotalCaloriesBurnedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -192,8 +197,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        TotalCaloriesBurnedRecord testRecord = getCompleteTotalCaloriesBurnedRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        TotalCaloriesBurnedRecord testRecord =
+                (TotalCaloriesBurnedRecord)
+                        TestUtils.insertRecord(getCompleteTotalCaloriesBurnedRecord());
         List<TotalCaloriesBurnedRecord> newTotalCaloriesBurnedRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(
@@ -422,8 +429,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteTotalCaloriesBurnedRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteTotalCaloriesBurnedRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -455,9 +463,8 @@
         assertThat(result).containsExactlyElementsIn(insertedRecord);
     }
 
-    private void readTotalCaloriesBurnedRecordUsingIds(List<Record> recordList)
+    private void readTotalCaloriesBurnedRecordUsingIds(List<Record> insertedRecords)
             throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
         ReadRecordsRequestUsingIds.Builder<TotalCaloriesBurnedRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(TotalCaloriesBurnedRecord.class);
         for (Record record : insertedRecords) {
diff --git a/tests/cts/src/android/healthconnect/cts/Vo2MaxRecordTest.java b/tests/cts/src/android/healthconnect/cts/Vo2MaxRecordTest.java
index 52af376..ea0f11f 100644
--- a/tests/cts/src/android/healthconnect/cts/Vo2MaxRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/Vo2MaxRecordTest.java
@@ -116,8 +116,8 @@
         List<Vo2MaxRecord> oldVo2MaxRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(Vo2MaxRecord.class).build());
-        Vo2MaxRecord testRecord = getCompleteVo2MaxRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        Vo2MaxRecord testRecord = (Vo2MaxRecord) TestUtils.insertRecord(getCompleteVo2MaxRecord());
         List<Vo2MaxRecord> newVo2MaxRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(Vo2MaxRecord.class).build());
@@ -132,8 +132,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        Vo2MaxRecord testRecord = getCompleteVo2MaxRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        Vo2MaxRecord testRecord = (Vo2MaxRecord) TestUtils.insertRecord(getCompleteVo2MaxRecord());
         List<Vo2MaxRecord> newVo2MaxRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(Vo2MaxRecord.class)
@@ -154,8 +154,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        Vo2MaxRecord testRecord = getCompleteVo2MaxRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        Vo2MaxRecord testRecord = (Vo2MaxRecord) TestUtils.insertRecord(getCompleteVo2MaxRecord());
         List<Vo2MaxRecord> newVo2MaxRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(Vo2MaxRecord.class)
@@ -236,8 +236,8 @@
 
     @Test
     public void testDeleteVo2MaxRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseVo2MaxRecord(), getCompleteVo2MaxRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBaseVo2MaxRecord(), getCompleteVo2MaxRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -274,10 +274,10 @@
 
     @Test
     public void testDeleteVo2MaxRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseVo2MaxRecord(), getCompleteVo2MaxRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBaseVo2MaxRecord(), getCompleteVo2MaxRecord()));
         List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        for (Record record : records) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
@@ -445,8 +445,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteVo2MaxRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteVo2MaxRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/WeightRecordTest.java b/tests/cts/src/android/healthconnect/cts/WeightRecordTest.java
index 06febc4..ea927aa 100644
--- a/tests/cts/src/android/healthconnect/cts/WeightRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/WeightRecordTest.java
@@ -142,8 +142,8 @@
         List<WeightRecord> oldWeightRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(WeightRecord.class).build());
-        WeightRecord testRecord = getCompleteWeightRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        WeightRecord testRecord = (WeightRecord) TestUtils.insertRecord(getCompleteWeightRecord());
         List<WeightRecord> newWeightRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(WeightRecord.class).build());
@@ -158,8 +158,8 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        WeightRecord testRecord = getCompleteWeightRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        WeightRecord testRecord = (WeightRecord) TestUtils.insertRecord(getCompleteWeightRecord());
         List<WeightRecord> newWeightRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(WeightRecord.class)
@@ -180,8 +180,8 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        WeightRecord testRecord = getCompleteWeightRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        WeightRecord testRecord = (WeightRecord) TestUtils.insertRecord(getCompleteWeightRecord());
         List<WeightRecord> newWeightRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(WeightRecord.class)
@@ -367,8 +367,8 @@
 
     @Test
     public void testDeleteWeightRecord_recordId_filters() throws InterruptedException {
-        List<Record> records = List.of(getBaseWeightRecord(), getCompleteWeightRecord());
-        TestUtils.insertRecords(records);
+        List<Record> records =
+                TestUtils.insertRecords(List.of(getBaseWeightRecord(), getCompleteWeightRecord()));
 
         for (Record record : records) {
             TestUtils.verifyDeleteRecords(
@@ -405,15 +405,15 @@
 
     @Test
     public void testDeleteWeightRecord_usingIds() throws InterruptedException {
-        List<Record> records = List.of(getBaseWeightRecord(), getCompleteWeightRecord());
-        List<Record> insertedRecord = TestUtils.insertRecords(records);
-        List<RecordIdFilter> recordIds = new ArrayList<>(records.size());
-        for (Record record : insertedRecord) {
+        List<Record> insertedRecords =
+                TestUtils.insertRecords(List.of(getBaseWeightRecord(), getCompleteWeightRecord()));
+        List<RecordIdFilter> recordIds = new ArrayList<>(insertedRecords.size());
+        for (Record record : insertedRecords) {
             recordIds.add(RecordIdFilter.fromId(record.getClass(), record.getMetadata().getId()));
         }
 
         TestUtils.verifyDeleteRecords(recordIds);
-        for (Record record : records) {
+        for (Record record : insertedRecords) {
             TestUtils.assertRecordNotFound(record.getMetadata().getId(), record.getClass());
         }
     }
@@ -572,8 +572,8 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteWeightRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(Collections.singletonList(getCompleteWeightRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
diff --git a/tests/cts/src/android/healthconnect/cts/WheelchairPushesRecordTest.java b/tests/cts/src/android/healthconnect/cts/WheelchairPushesRecordTest.java
index 66efed7..e31b8c4 100644
--- a/tests/cts/src/android/healthconnect/cts/WheelchairPushesRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/WheelchairPushesRecordTest.java
@@ -89,8 +89,10 @@
     @Test
     public void testReadWheelchairPushesRecord_usingIds() throws InterruptedException {
         List<Record> recordList =
-                Arrays.asList(
-                        getCompleteWheelchairPushesRecord(), getCompleteWheelchairPushesRecord());
+                TestUtils.insertRecords(
+                        Arrays.asList(
+                                getCompleteWheelchairPushesRecord(),
+                                getCompleteWheelchairPushesRecord()));
         readWheelchairPushesRecordUsingIds(recordList);
     }
 
@@ -130,8 +132,10 @@
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(WheelchairPushesRecord.class)
                                 .build());
-        WheelchairPushesRecord testRecord = getCompleteWheelchairPushesRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        WheelchairPushesRecord testRecord =
+                (WheelchairPushesRecord)
+                        TestUtils.insertRecord(getCompleteWheelchairPushesRecord());
         List<WheelchairPushesRecord> newWheelchairPushesRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(WheelchairPushesRecord.class)
@@ -153,8 +157,10 @@
                         .setStartTime(Instant.now())
                         .setEndTime(Instant.now().plusMillis(3000))
                         .build();
-        WheelchairPushesRecord testRecord = getCompleteWheelchairPushesRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        WheelchairPushesRecord testRecord =
+                (WheelchairPushesRecord)
+                        TestUtils.insertRecord(getCompleteWheelchairPushesRecord());
         List<WheelchairPushesRecord> newWheelchairPushesRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(WheelchairPushesRecord.class)
@@ -180,8 +186,10 @@
                                                 .setPackageName(context.getPackageName())
                                                 .build())
                                 .build());
-        WheelchairPushesRecord testRecord = getCompleteWheelchairPushesRecord();
-        TestUtils.insertRecords(Collections.singletonList(testRecord));
+
+        WheelchairPushesRecord testRecord =
+                (WheelchairPushesRecord)
+                        TestUtils.insertRecord(getCompleteWheelchairPushesRecord());
         List<WheelchairPushesRecord> newWheelchairPushesRecords =
                 TestUtils.readRecords(
                         new ReadRecordsRequestUsingFilters.Builder<>(WheelchairPushesRecord.class)
@@ -416,8 +424,9 @@
         assertThat(response.getUpsertedRecords().size()).isEqualTo(0);
         assertThat(response.getDeletedLogs().size()).isEqualTo(0);
 
-        List<Record> testRecord = Collections.singletonList(getCompleteWheelchairPushesRecord());
-        TestUtils.insertRecords(testRecord);
+        List<Record> testRecord =
+                TestUtils.insertRecords(
+                        Collections.singletonList(getCompleteWheelchairPushesRecord()));
         response = TestUtils.getChangeLogs(changeLogsRequest);
         assertThat(response.getUpsertedRecords().size()).isEqualTo(1);
         assertThat(
@@ -449,18 +458,17 @@
         assertThat(result).containsExactlyElementsIn(insertedRecord);
     }
 
-    private void readWheelchairPushesRecordUsingIds(List<Record> recordList)
+    private void readWheelchairPushesRecordUsingIds(List<Record> records)
             throws InterruptedException {
-        List<Record> insertedRecords = TestUtils.insertRecords(recordList);
         ReadRecordsRequestUsingIds.Builder<WheelchairPushesRecord> request =
                 new ReadRecordsRequestUsingIds.Builder<>(WheelchairPushesRecord.class);
-        for (Record record : insertedRecords) {
+        for (Record record : records) {
             request.addId(record.getMetadata().getId());
         }
         List<WheelchairPushesRecord> result = TestUtils.readRecords(request.build());
-        assertThat(result).hasSize(insertedRecords.size());
-        assertThat(result.size()).isEqualTo(insertedRecords.size());
-        assertThat(result).containsExactlyElementsIn(insertedRecords);
+        assertThat(result).hasSize(records.size());
+        assertThat(result.size()).isEqualTo(records.size());
+        assertThat(result).containsExactlyElementsIn(records);
     }
 
     @Test(expected = IllegalArgumentException.class)
diff --git a/tests/cts/utils/HealthConnectTestUtils/src/android/healthconnect/cts/utils/TestUtils.java b/tests/cts/utils/HealthConnectTestUtils/src/android/healthconnect/cts/utils/TestUtils.java
index 17e776f..4185464 100644
--- a/tests/cts/utils/HealthConnectTestUtils/src/android/healthconnect/cts/utils/TestUtils.java
+++ b/tests/cts/utils/HealthConnectTestUtils/src/android/healthconnect/cts/utils/TestUtils.java
@@ -215,6 +215,16 @@
                 .getId();
     }
 
+     /**
+     * Insert record to the database.
+     *
+     * @param record record to insert
+     * @return inserted record
+     */
+    public static Record insertRecord(Record record) throws InterruptedException {
+        return insertRecords(Collections.singletonList(record)).get(0);
+    }
+
     /**
      * Inserts records to the database.
      *