docs: private void handleMainMethodIfPresent(List methods) {
          boolean found = false;
          for (Iterator iter = methods.iterator(); iter.hasNext();) {
              MethodNode node = (MethodNode) iter.next();
              if(node.getName().equals("main")) {
                  if (node.isStatic() && node.getParameters().length == 1) {
                      boolean retTypeMatches, argTypeMatches;
                      ClassNode argType = node.getParameters()[0].getType();
                      ClassNode retType = node.getReturnType();
  
                      argTypeMatches = (argType.equals(ClassHelper.OBJECT_TYPE) || argType.getName().contains("String[]"));
                      retTypeMatches = (retType == ClassHelper.VOID_TYPE || retType == ClassHelper.OBJECT_TYPE);
                      
                      if(retTypeMatches && argTypeMatches) {
                          if(found) {
                              throw new RuntimeException("Repetitive main method found.");
                          } else {
                              found = true;
                          }
                          // if script has both loose statements as well as main(), then main() is ignored
                          if(statementBlock.isEmpty()) {
                              addStatement(node.getCode());
                          }
                          iter.remove();
                      }
                  }
              }
          }
      }