code: public List<List<AbstractFeature>> getFlattenFeatureHierarchy() {
          List<List<AbstractFeature>> result = new ArrayList<>();
  
          List<AbstractFeature> previousLevel = new ArrayList<>(getSortedFeatures());
          result.add(previousLevel);
  
          while (!previousLevel.isEmpty()) {
              List<AbstractFeature> currentLevel = new ArrayList<>();
              boolean isTopLevel = true;
  
              for (AbstractFeature feature : previousLevel) {
                  if (feature.getParentGroup() != null) {
                      isTopLevel = false;
                      currentLevel.add(feature.getParentGroup());
                  } else {
                      currentLevel.add(feature);
                  }
  
              }
  
              if (!isTopLevel) {
                  result.add(currentLevel);
                  previousLevel = currentLevel;
              } else {
                  previousLevel = new ArrayList<>();
              }
          }
  
          Collections.reverse(result);
  
          return result;
      }
docs: Return the flatten hierarchy of features
  The features are sorted with respect to the metadata
  Feature groups are referenced multiple times to respect the hierarchy with the subfeatures
  e.g. FG(A,B) gives FG, FG; A, B
  @return flatten hierarchy