// Path: breakerbox-azure/src/main/java/com/yammer/breakerbox/azure/core/TableKey.java
// public interface TableKey {
//     String getRowKey();
//     String getPartitionKey();
//     Class<? extends TableServiceEntity> getEntityClass();
//     AzureTableName getTable();
// }
// 
// Path: breakerbox-azure/src/main/java/com/yammer/breakerbox/azure/core/TableType.java
// public abstract class TableType extends TableServiceEntity {
//     protected final AzureTableName azureTableName;
// 
//     protected TableType(AzureTableName azureTableName) {
//         this.azureTableName = checkNotNull(azureTableName, "azureTableName cannot be null");
//     }
// 
//     public AzureTableName getAzureTableName() {
//         return azureTableName;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (!(o instanceof TableType)) return false;
// 
//         TableType that = (TableType) o;
// 
//         if (azureTableName != that.azureTableName) return false;
//         if (partitionKey != null ? !partitionKey.equals(that.partitionKey) : that.partitionKey != null) return false;
//         if (rowKey != null ? !rowKey.equals(that.rowKey) : that.rowKey != null) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = azureTableName.hashCode();
//         result = 31 * result + (partitionKey != null ? partitionKey.hashCode() : 0);
//         result = 31 * result + (rowKey != null ? rowKey.hashCode() : 0);
//         return result;
//     }
// }


import com.google.common.collect.ImmutableList;
import com.microsoft.azure.storage.StorageException;
import com.microsoft.azure.storage.table.*;
import com.yammer.breakerbox.azure.core.AzureTableName;
import com.yammer.breakerbox.azure.core.TableKey;
import com.yammer.breakerbox.azure.core.TableType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.core.Response;
import java.net.URISyntaxException;
import java.util.Optional;
import static com.google.common.base.Preconditions.checkNotNull;
package com.yammer.breakerbox.azure;




public class TableClient {

    private final CloudTableClient cloudTableClient;
    private static final Logger LOG = LoggerFactory.getLogger(TableClient.class);

    public TableClient(CloudTableClient cloudTableClient) {
        this.cloudTableClient = checkNotNull(cloudTableClient, "cloudTableClient cannot be null");
    }

    private CloudTable tableRefrence(AzureTableName table) {
        try {
            return cloudTableClient.getTableReference(table.toString());
        } catch (URISyntaxException e) {
            LOG.warn("URI exception creating table: {},", table, e);
        } catch (StorageException e) {
            LOG.warn("Error generating TableClient: {}", table, e);
        }
        throw new IllegalStateException("Could not create table: " + table);
    }

    public void create(AzureTableName table) {
        try {
            tableRefrence(table).createIfNotExists();
            return;
        } catch (StorageException e) {
            LOG.warn("Error creating table: {}", table, e);
        }
        throw new IllegalStateException("Could not create table: " + table);
    }

// Path: breakerbox-azure/src/main/java/com/yammer/breakerbox/azure/core/TableKey.java
// public interface TableKey {
//     String getRowKey();
//     String getPartitionKey();
//     Class<? extends TableServiceEntity> getEntityClass();
//     AzureTableName getTable();
// }
// 
// Path: breakerbox-azure/src/main/java/com/yammer/breakerbox/azure/core/TableType.java
// public abstract class TableType extends TableServiceEntity {
//     protected final AzureTableName azureTableName;
// 
//     protected TableType(AzureTableName azureTableName) {
//         this.azureTableName = checkNotNull(azureTableName, "azureTableName cannot be null");
//     }
// 
//     public AzureTableName getAzureTableName() {
//         return azureTableName;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (!(o instanceof TableType)) return false;
// 
//         TableType that = (TableType) o;
// 
//         if (azureTableName != that.azureTableName) return false;
//         if (partitionKey != null ? !partitionKey.equals(that.partitionKey) : that.partitionKey != null) return false;
//         if (rowKey != null ? !rowKey.equals(that.rowKey) : that.rowKey != null) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = azureTableName.hashCode();
//         result = 31 * result + (partitionKey != null ? partitionKey.hashCode() : 0);
//         result = 31 * result + (rowKey != null ? rowKey.hashCode() : 0);
//         return result;
//     }
// }


// Path: breakerbox-azure/src/main/java/com/yammer/breakerbox/azure/TableClient.java
import com.google.common.collect.ImmutableList;
import com.microsoft.azure.storage.StorageException;
import com.microsoft.azure.storage.table.*;
import com.yammer.breakerbox.azure.core.AzureTableName;
import com.yammer.breakerbox.azure.core.TableKey;
import com.yammer.breakerbox.azure.core.TableType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.core.Response;
import java.net.URISyntaxException;
import java.util.Optional;
import static com.google.common.base.Preconditions.checkNotNull;

package com.yammer.breakerbox.azure;




public class TableClient {

    private final CloudTableClient cloudTableClient;
    private static final Logger LOG = LoggerFactory.getLogger(TableClient.class);

    public TableClient(CloudTableClient cloudTableClient) {
        this.cloudTableClient = checkNotNull(cloudTableClient, "cloudTableClient cannot be null");
    }

    private CloudTable tableRefrence(AzureTableName table) {
        try {
            return cloudTableClient.getTableReference(table.toString());
        } catch (URISyntaxException e) {
            LOG.warn("URI exception creating table: {},", table, e);
        } catch (StorageException e) {
            LOG.warn("Error generating TableClient: {}", table, e);
        }
        throw new IllegalStateException("Could not create table: " + table);
    }

    public void create(AzureTableName table) {
        try {
            tableRefrence(table).createIfNotExists();
            return;
        } catch (StorageException e) {
            LOG.warn("Error creating table: {}", table, e);
        }
        throw new IllegalStateException("Could not create table: " + table);
    }

    public boolean insert(TableType entity) {