docs: public static ClassNode inferLoopElementType(final ClassNode collectionType) {
          ClassNode componentType = collectionType.getComponentType();
          if (componentType == null) {
              if (implementsInterfaceOrIsSubclassOf(collectionType, ITERABLE_TYPE)) {
                  ClassNode intf = GenericsUtils.parameterizeType(collectionType, ITERABLE_TYPE);
                  GenericsType[] genericsTypes = intf.getGenericsTypes();
                  componentType = genericsTypes[0].getType();
              } else if (implementsInterfaceOrIsSubclassOf(collectionType, MAP_TYPE)) {
                  // GROOVY-6240
                  ClassNode intf = GenericsUtils.parameterizeType(collectionType, MAP_TYPE);
                  GenericsType[] genericsTypes = intf.getGenericsTypes();
                  componentType = MAP_ENTRY_TYPE.getPlainNodeReference();
                  componentType.setGenericsTypes(genericsTypes);
              } else if (STRING_TYPE.equals(collectionType)) {
                  componentType = ClassHelper.STRING_TYPE;
              } else if (ENUMERATION_TYPE.equals(collectionType)) {
                  // GROOVY-6123
                  ClassNode intf = GenericsUtils.parameterizeType(collectionType, ENUMERATION_TYPE);
                  GenericsType[] genericsTypes = intf.getGenericsTypes();
                  componentType = genericsTypes[0].getType();
              } else {
                  componentType = ClassHelper.OBJECT_TYPE;
              }
          }
          return componentType;
      }