### Question:
IndexSpecification implements WritableComparable<IndexSpecification> { public void addIndexColumn(HColumnDescriptor cf, String qualifier, ValueType type, int maxValueLength) throws IllegalArgumentException { type = checkForType(type); isValidFamilyAndQualifier(cf, qualifier); maxValueLength = getMaxLength(type, maxValueLength); ColumnQualifier cq = new ColumnQualifier(cf.getNameAsString(), qualifier, type, maxValueLength); isNotDuplicateEntry(cq); formMinTTL(cf); formMaxVersions(cf); internalAdd(cq); } IndexSpecification();  IndexSpecification(String name);  IndexSpecification(byte[] name); String getName(); void addIndexColumn(HColumnDescriptor cf, String qualifier, ValueType type,
      int maxValueLength); void addIndexColumn(HColumnDescriptor cf, String qualifier, ValuePartition vp,
      ValueType type, int maxValueLength); Set<ColumnQualifier> getIndexColumns(); void readFields(DataInput in); void write(DataOutput out); int compareTo(IndexSpecification o); String toString(); boolean equals(Object obj); int hashCode(); ColumnQualifier getLastColumn(); boolean contains(byte[] family); boolean contains(byte[] family, byte[] qualifier); int getTotalValueLength(); long getTTL(); int getMaxVersions();  }### Answer:
@Test public void testAddIndexColumnWithNullCF() throws Exception { IndexSpecification iSpec = new IndexSpecification("index_name"); try { iSpec.addIndexColumn(null, "cq", ValueType.String, 10); fail("Column family name should not be null in index specification."); } catch (IllegalArgumentException e) { } }
@Test public void testAddIndexColumnWithNullQualifier() throws Exception { IndexSpecification iSpec = new IndexSpecification("index_name"); try { iSpec.addIndexColumn(new HColumnDescriptor("cf"), null, ValueType.String, 10); fail("Column qualifier name should not be null in index specification."); } catch (IllegalArgumentException e) { } }
@Test public void testAddIndexColumnWithBlankCForQualifier() throws Exception { IndexSpecification iSpec = new IndexSpecification("index_name"); try { iSpec.addIndexColumn(new HColumnDescriptor(" "), " ", ValueType.String, 10); fail("Column family name and qualifier should not be blank."); } catch (IllegalArgumentException e) { } }
@Test public void testAddIndexColumnWithBlankCF() throws Exception { IndexSpecification iSpec = new IndexSpecification("index_name"); try { iSpec.addIndexColumn(new HColumnDescriptor(" "), "cq", ValueType.String, 10); fail("Column family name should not be blank."); } catch (IllegalArgumentException e) { } }
@Test public void testAddIndexColumnWithBlankQualifier() throws Exception { IndexSpecification iSpec = new IndexSpecification("index_name"); try { iSpec.addIndexColumn(new HColumnDescriptor("cf"), " ", ValueType.String, 10); fail("Column qualifier name should not be blank."); } catch (IllegalArgumentException e) { } }
@Test public void testAddIndexColumnWithControlCharactersOrColonsInCF() throws Exception { IndexSpecification iSpec = new IndexSpecification("index_name"); try { iSpec.addIndexColumn(new HColumnDescriptor("cf:"), "cq", ValueType.String, 10); fail("Family names should not contain control characters or colons."); } catch (IllegalArgumentException e) { } }
@Test public void testAddIndexColumnWithDuplicaCFandQualifier() throws Exception { IndexSpecification iSpec = new IndexSpecification("index_name"); try { iSpec.addIndexColumn(new HColumnDescriptor("cf"), "cq", ValueType.String, 10); iSpec.addIndexColumn(new HColumnDescriptor("cf"), "cq", ValueType.String, 10); fail("Column familily and qualifier combination should not be" + " repeated in Index Specification."); } catch (IllegalArgumentException e) { } }