docs: private void initStoreDefinitions(Version storesXmlVersion) {
          if(this.storeDefinitionsStorageEngine == null) {
              throw new VoldemortException("The store definitions directory is empty");
          }
  
          String allStoreDefinitions = "<stores>";
          Version finalStoresXmlVersion = null;
          if(storesXmlVersion != null) {
              finalStoresXmlVersion = storesXmlVersion;
          }
          this.storeNames.clear();
  
          ClosableIterator<Pair<String, Versioned<String>>> storesIterator = this.storeDefinitionsStorageEngine.entries();
  
          // Some test setups may result in duplicate entries for 'store' element.
          // Do the de-dup here
          Map<String, Versioned<String>> storeNameToDefMap = new HashMap<String, Versioned<String>>();
          Version maxVersion = null;
          while(storesIterator.hasNext()) {
              Pair<String, Versioned<String>> storeDetail = storesIterator.next();
              String storeName = storeDetail.getFirst();
              Versioned<String> versionedStoreDef = storeDetail.getSecond();
              storeNameToDefMap.put(storeName, versionedStoreDef);
              Version curVersion = versionedStoreDef.getVersion();
  
              // Get the highest version from all the store entries
              if(maxVersion == null) {
                  maxVersion = curVersion;
              } else if(maxVersion.compare(curVersion) == Occurred.BEFORE) {
                  maxVersion = curVersion;
              }
          }
  
          // If the specified version is null, assign highest Version to
          // 'stores.xml' key
          if(finalStoresXmlVersion == null) {
              finalStoresXmlVersion = maxVersion;
          }
  
          // Go through all the individual stores and update metadata
          for(Entry<String, Versioned<String>> storeEntry: storeNameToDefMap.entrySet()) {
              String storeName = storeEntry.getKey();
              Versioned<String> versionedStoreDef = storeEntry.getValue();
  
              // Add all the store names to the list of storeNames
              this.storeNames.add(storeName);
  
              this.metadataCache.put(storeName, new Versioned<Object>(versionedStoreDef.getValue(),
                                                                      versionedStoreDef.getVersion()));
          }
  
          Collections.sort(this.storeNames);
          for(String storeName: this.storeNames) {
              Versioned<String> versionedStoreDef = storeNameToDefMap.get(storeName);
              // Stitch together to form the complete store definition list.
              allStoreDefinitions += versionedStoreDef.getValue();
  
          }
  
          allStoreDefinitions += "</stores>";
  
          // Update cache with the composite store definition list.
          metadataCache.put(STORES_KEY,
                            convertStringToObject(STORES_KEY,
                                                  new Versioned<String>(allStoreDefinitions,
                                                                        finalStoresXmlVersion)));
      }