assertNotNull(schemaBefore);
assertTrue(schemaBefore.getIndices().isEmpty());
// Add a new index to the table
hbaseMetadata.createTableIndex(tableId,
new IndexSchema(INDEX_NAME, ImmutableList.<String>of(COLUMN_NAME), false));
// Verify that the table schema has been correctly updated
final TableSchema schemaAfter = hbaseMetadata.getSchema(tableId);
assertNotNull(schemaAfter);
final Collection<IndexSchema> schemaIndices = schemaAfter.getIndices();
assertEquals(1, schemaIndices.size());
final IndexSchema newIndexDetails = Iterables.find(schemaIndices, indexPredicate);
assertNotNull(newIndexDetails);
final List<String> indexColumns = newIndexDetails.getColumns();
assertEquals(1, indexColumns.size());
assertEquals(COLUMN_NAME, indexColumns.get(0));
assertEquals(false, newIndexDetails.getIsUnique());
// Verify that the new index has been stored correctly
final Map<String, Long> tableIndexInfo = hbaseMetadata.getIndexIds(tableId);
assertEquals(1, tableIndexInfo.size());
assertTrue(tableIndexInfo.containsKey(INDEX_NAME));