code: public static boolean isCollection(EntityDataModel entityDataModel, String typeName) {
          EntitySet entitySet = entityDataModel.getEntityContainer().getEntitySet(typeName);
          if (entitySet != null) {
              return true;
          }
          try {
              if (Collection.class.isAssignableFrom(Class.forName(typeName))
                      || COLLECTION_PATTERN.matcher(typeName).matches()) {
                  return true;
              }
          } catch (ClassNotFoundException e) {
              LOG.debug("Not possible to find class for type name: {}", typeName);
          }
  
          return false;
      }
docs: Checks if the specified typeName is a collection.
  
  @param entityDataModel The entity data model.
  @param typeName        The type name to check.
  @return True if the type is a collection, False if not