TableSchema { public String getAutoIncrementColumn() { for (ColumnSchema entry : columns) { if (entry.getIsAutoIncrement()) { return entry.getColumnName(); } } return null; } TableSchema(Collection<ColumnSchema> columns, Collection<IndexSchema> indices); private  TableSchema(AvroTableSchema avroTableSchema); static TableSchema deserialize(byte[] serializedTableSchema); TableSchema schemaCopy(); byte[] serialize(); Collection<ColumnSchema> getColumns(); Collection<IndexSchema> getIndices(); void addIndices(Collection<IndexSchema> indices); void removeIndex(String indexName); boolean hasIndices(); boolean hasUniqueIndices(); ColumnSchema getColumnSchema(String columnName); IndexSchema getIndexSchema(String indexName); String getAutoIncrementColumn(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testGetAutoIncColumnNoAutoIncColumns() { final TableSchema schema = new TableSchema(ImmutableList.<ColumnSchema>of(FAKE_COL_SCHEMA), INDICES); assertEquals(null, schema.getAutoIncrementColumn()); }
@Test public void testGetAutoIncColumns() { assertEquals(COLUMN_A, tableSchema.getAutoIncrementColumn()); }