code: private ProvisioningFeatureDefinition getPreferredVersion(String symbolicName, List<ProvisioningFeatureDefinition> featureList) {
          Version preferredVersion = symbolicNameToPreferredVersion.get(symbolicName);
          ProvisioningFeatureDefinition result = null;
  
          if (preferredVersion != null) {
              for (ProvisioningFeatureDefinition feature : featureList) {
                  if (preferredVersion.equals(feature.getVersion())) {
                      result = feature;
                      break;
                  }
              }
          }
  
          if (result == null) {
              result = featureList.iterator().next();
          }
  
          return result;
      }
docs: Find the preferred version of a feature from the list of features
  <p>
  The decision is made by consulting {@link #symbolicNameToPreferredVersion} to find out whether the user has configured a preferred version. If so, look for a feature with
  that version.
  <p>
  If no preferred version has been configured for this symbolic name, or if the preferred version cannot be found in the list, return the latest version.
  
  @param symbolicName the symbolic name of the feature
  @param featureList the list of features, which should all have the same symbolic name
  @return the best feature from the list