code: @SuppressWarnings("unchecked")
      public <R> MultiEnvAware<R> convert(BiFunction<String, T, R> func, TemplateResolver tr) {
          MultiEnvAware<R> result;
          if (this.hasTemplateEnvironment() && tr != null) {
              result = new LazyMultiEnvAware<>(tr);
          } else {
              result = new MultiEnvAware<>();
          }
          for (Entry<String, T> entry : map.entrySet()) {
              R r = func.apply(entry.getKey(), entry.getValue());
              result.put(entry.getKey(), r);
          }
          result.defaultEnvironment = this.defaultEnvironment;
          result.templateEnvironment = this.templateEnvironment;
          return result;
      }
docs: Utility method for MultiEnvAware config transformation
  
  @param <R>
  @param func - transformation function
  @param tr The template resolver to use
  @return new MultiEnvAware instance