public synchronized void write(Mutation tableRecord) throws IllegalStateException {
    write(ImmutableList.of(tableRecord));
  }
@Test
  public void testWriteSingleRecordShouldThrowExceptionWhenSpannerWriteFails()
      throws ExecutionException, InterruptedException {
    // arrange
    prepareTable();
    when(spanner.getDatabaseClient(any()).write(any())).thenThrow(SpannerException.class);
    Mutation testMutation =
        Mutation.newInsertOrUpdateBuilder("SingerId")
            .set("SingerId")
            .to(1)
            .set("FirstName")
            .to("Marc")
            .set("LastName")
            .to("Richards")
            .build();

    // act & assert
    assertThrows(SpannerResourceManagerException.class, () -> testManager.write(testMutation));
  }