source: class IndexUtilsTest {
  
      private static final String DB_NAME;
      private static final String TABLE_NAME;
      private final String INDEX_NAME;
      private final IndexType INDEX_DEFAULT;
      private final ColumnType COLUMN_VARCHAR;
      private final String COLUMN_NAME;
      private final String COLUMN_NAME2;
  
      @Test
      public void getCustomCompoundIndexDBObjectTest() throws MongoValidationException {
  
target:         IndexMetadataBuilder indexMetaBuilder = new IndexMetadataBuilder(DB_NAME, TABLE_NAME, INDEX_NAME,
                          IndexType.CUSTOM);
          indexMetaBuilder.addOption(IndexOptions.INDEX_TYPE.getOptionName(),
                          CustomMongoIndexType.COMPOUND.getIndexType());
          indexMetaBuilder.addOption(IndexOptions.COMPOUND_FIELDS.getOptionName(), COLUMN_NAME + ":desc," + COLUMN_NAME2
                          + ":asc");
          IndexMetadata indexMetadata = indexMetaBuilder.build();
  
          DBObject object = IndexUtils.getIndexDBObject(indexMetadata);
  
          assertEquals("The value of the descending index " + COLUMN_NAME + " should be '-1'", -1,
                          object.get(COLUMN_NAME));
          assertEquals("The value of the ascending index " + COLUMN_NAME2 + " should be '1'", 1, object.get(COLUMN_NAME2));
  
      }
  
  }