code: public void insertOrReplace(final TableEntity entity) {
          this.lockToPartitionKey(entity.getPartitionKey());
          this.add(TableOperation.insertOrReplace(entity));
      }
docs: Adds a table operation to insert or replace the specified entity to the batch operation.
  
  @param entity
  The {@link TableEntity} to insert if not found or to replace if it exists.