docs: @SuppressWarnings("rawtypes")
    protected int resolveNrOfInstances(DelegateExecution execution) {
      if (loopCardinalityExpression != null) {
        return resolveLoopCardinality(execution);
  
      } else if(usesCollection()) {
        Collection collection = resolveAndValidateCollection(execution);
        return collection.size();
  
      } else {
        throw new ActivitiIllegalArgumentException("Couldn't resolve collection expression nor variable reference");
      }
    }