code: public static CellNameType getIndexComparator(CFMetaData baseMetadata, ColumnDefinition cfDef)
      {
          if (cfDef.type.isCollection() && cfDef.type.isMultiCell())
          {
              switch (((CollectionType)cfDef.type).kind)
              {
                  case LIST:
                      return CompositesIndexOnCollectionValue.buildIndexComparator(baseMetadata, cfDef);
                  case SET:
                      return CompositesIndexOnCollectionKey.buildIndexComparator(baseMetadata, cfDef);
                  case MAP:
                      return cfDef.hasIndexOption(SecondaryIndex.INDEX_KEYS_OPTION_NAME)
                           ? CompositesIndexOnCollectionKey.buildIndexComparator(baseMetadata, cfDef)
                           : CompositesIndexOnCollectionValue.buildIndexComparator(baseMetadata, cfDef);
              }
          }
  
          switch (cfDef.kind)
          {
              case CLUSTERING_COLUMN:
                  return CompositesIndexOnClusteringKey.buildIndexComparator(baseMetadata, cfDef);
              case REGULAR:
                  return CompositesIndexOnRegular.buildIndexComparator(baseMetadata, cfDef);
              case PARTITION_KEY:
                  return CompositesIndexOnPartitionKey.buildIndexComparator(baseMetadata, cfDef);
              //case COMPACT_VALUE:
              //    return CompositesIndexOnCompactValue.buildIndexComparator(baseMetadata, cfDef);
          }
          throw new AssertionError();
      }
docs: Check SecondaryIndex.getIndexComparator if you want to know why this is static