TableSchema { public ColumnSchema getColumnSchema(String columnName) { Verify.isNotNullOrEmpty(columnName); AvroColumnSchema columnSchema = avroTableSchema.getColumns().get(columnName); return new ColumnSchema(columnName, columnSchema); } 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(expected = IllegalArgumentException.class) public void testGetColumnSchemaEmptyColumnName() { tableSchema.getColumnSchema(""); }
@Test(expected = NullPointerException.class) public void testGetColumnSchemaInvalidColumnName() { tableSchema.getColumnSchema(null); }
@Test public void testGetColumnSchemaValidColumnName() { final TableSchema schema = new TableSchema(ImmutableList.<ColumnSchema>of(FAKE_COL_SCHEMA), INDICES); final ColumnSchema actual = schema.getColumnSchema(FAKE_COL_SCHEMA.getColumnName()); assertEquals(FAKE_COL_SCHEMA.getColumnName(), actual.getColumnName()); assertEquals(FAKE_COL_SCHEMA, actual); }