public synchronized void write(Mutation tableRecord) throws IllegalStateException {
    write(ImmutableList.of(tableRecord));
  }
@Test
  public void testWriteMultipleRecordsShouldWorkWhenSpannerWriteSucceeds()
      throws ExecutionException, InterruptedException {
    // arrange
    prepareTable();
    when(spanner.getDatabaseClient(any()).write(any())).thenReturn(Timestamp.now());
    ImmutableList<Mutation> testMutations =
        ImmutableList.of(
            Mutation.newInsertOrUpdateBuilder("SingerId")
                .set("SingerId")
                .to(1)
                .set("FirstName")
                .to("Marc")
                .set("LastName")
                .to("Richards")
                .build(),
            Mutation.newInsertOrUpdateBuilder("SingerId")
                .set("SingerId")
                .to(2)
                .set("FirstName")
                .to("Catalina")
                .set("LastName")
                .to("Smith")
                .build());

    // act
    testManager.write(testMutations);

    // assert
    verify(spanner.getDatabaseClient(any())).write(writeMutationCaptor.capture());
    Iterable<Mutation> actualWriteMutation = writeMutationCaptor.getValue();

    assertThat(actualWriteMutation).containsExactlyElementsIn(testMutations);
  }