code: public static List<String> getIndexNames(final List<IndexModel> indexes, final CodecRegistry codecRegistry) {
          List<String> indexNames = new ArrayList<String>(indexes.size());
          for (IndexModel index : indexes) {
              String name = index.getOptions().getName();
              if (name != null) {
                  indexNames.add(name);
              } else {
                  indexNames.add(IndexHelper.generateIndexName(index.getKeys().toBsonDocument(BsonDocument.class, codecRegistry)));
              }
          }
          return indexNames;
      }
docs: Get a list of index names for the given list of index models
  
  @param indexes the index models
  @param codecRegistry the codec registry to convert each Bson key to a BsonDocument
  @return the list of index names