public Timestamp insert(PartitionMetadata row) {
    final TransactionResult<Void> transactionResult =
        runInTransaction(transaction -> transaction.insert(row), "InsertsPartitionMetadata");
    return transactionResult.getCommitTimestamp();
  }
@Test
  public void testInTransactionContextInsert() {
    ArgumentCaptor<ImmutableList<Mutation>> mutations =
        ArgumentCaptor.forClass(ImmutableList.class);
    doNothing().when(transaction).buffer(mutations.capture());
    assertNull(inTransactionContext.insert(ROW));
    assertEquals(1, mutations.getValue().size());
    Map<String, Value> mutationValueMap = mutations.getValue().iterator().next().asMap();
    assertEquals(
        ROW.getPartitionToken(),
        mutationValueMap.get(PartitionMetadataAdminDao.COLUMN_PARTITION_TOKEN).getString());
    assertEquals(
        ImmutableList.of(PARENT_TOKEN),
        mutationValueMap.get(PartitionMetadataAdminDao.COLUMN_PARENT_TOKENS).getStringArray());
    assertEquals(
        ROW.getStartTimestamp(),
        mutationValueMap.get(PartitionMetadataAdminDao.COLUMN_START_TIMESTAMP).getTimestamp());
    assertEquals(
        ROW.getEndTimestamp(),
        mutationValueMap.get(PartitionMetadataAdminDao.COLUMN_END_TIMESTAMP).getTimestamp());
    assertEquals(
        ROW.getHeartbeatMillis(),
        mutationValueMap.get(PartitionMetadataAdminDao.COLUMN_HEARTBEAT_MILLIS).getInt64());
    assertEquals(
        ROW.getState().toString(),
        mutationValueMap.get(PartitionMetadataAdminDao.COLUMN_STATE).getString());
    assertEquals(
        ROW.getWatermark(),
        mutationValueMap.get(PartitionMetadataAdminDao.COLUMN_WATERMARK).getTimestamp());
  }