code: private void updateArrayOfGetters(ClassOutline co, JCodeModel model) {
      JDefinedClass implClass = co.implClass;
  
      List<JMethod> removedMethods = new ArrayList<>();
      Iterator<JMethod> iter = implClass.methods().iterator();
      while (iter.hasNext()) {
        JMethod method = iter.next();
        if (method.type().name().startsWith("ArrayOf")) {
          removedMethods.add(method);
          iter.remove();
        }
      }
  
      for (JMethod removed : removedMethods) {
        // Parse the old code to get the variable name
        StringWriter oldWriter = new StringWriter();
        removed.body().state(new JFormatter(oldWriter));
        String oldBody = oldWriter.toString();
        String varName = oldBody.substring(oldBody.indexOf("return ") + "return ".length(), oldBody.indexOf(";"));
  
        // Build the new method
        JClass newReturnType = (JClass) ((JDefinedClass) removed.type()).fields().values().iterator().next().type();
        JMethod newMethod = implClass.method(removed.mods().getValue(), newReturnType, removed.name());
        JFieldVar field = implClass.fields().get(varName);          
        JClass typeParameter = newReturnType.getTypeParameters().get(0);
        String fieldName = model._getClass(field.type().fullName()).fields().keySet().iterator().next();
  
        newMethod.body()._return(
            JOp.cond(field.eq(JExpr._null()),
                JExpr._new(model.ref("java.util.ArrayList").narrow(typeParameter)),
                field.invoke("get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1))));
      }    
    }
docs: Update getters to use Java List. For example:
  ArrayOfInvoices getInvoices() -> List<Invoice> getInvoices()