@Test
public void getCustomOptionsTest() throws MongoValidationException {

    IndexMetadataBuilder indexMetaBuilder = new IndexMetadataBuilder(DB_NAME, TABLE_NAME, INDEX_NAME, INDEX_DEFAULT);
    indexMetaBuilder.addColumn(COLUMN_NAME, COLUMN_VARCHAR);
    indexMetaBuilder.addOption(IndexOptions.SPARSE.getOptionName(), true).addOption(
                    IndexOptions.UNIQUE.getOptionName(), false);
    IndexMetadata indexMetadata = indexMetaBuilder.build();
    DBObject object = IndexUtils.getCustomOptions(indexMetadata);
    assertEquals("The index name is not the expected", object.get("name"), INDEX_NAME);
    assertEquals("The 'sparse' property should be true", object.get("sparse"), true);
    assertEquals("The 'unique' property should be false", object.get("unique"), false);
}