[jnigen] Generating List/Map/... from classes in `package:jni` (https://github.com/dart-lang/jnigen/issues/291)

Now some util classes: List, Map, Set and Iterator and boxed types (java.lang.Number, Byte, Integer, ...) are generated from `package:jni` readily available classes.
diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md
index c136763..08d66d8 100644
--- a/pkgs/jni/CHANGELOG.md
+++ b/pkgs/jni/CHANGELOG.md
@@ -1,4 +1,4 @@
-## 0.5.0-dev.0
+## 0.5.0
 * **Breaking Change** ([#137](https://github.com/dart-lang/jnigen/issues/137)): Java primitive types are now all lowercase like `jint`, `jshort`, ...
 * The bindings for `java.util.Set`, `java.util.Map`, `java.util.List` and the numeric types like `java.lang.Integer`, `java.lang.Boolean`, ... are now included in `package:jni`.
 
diff --git a/pkgs/jni/example/pubspec.lock b/pkgs/jni/example/pubspec.lock
index 2edbc75..3080aea 100644
--- a/pkgs/jni/example/pubspec.lock
+++ b/pkgs/jni/example/pubspec.lock
@@ -200,7 +200,7 @@
       path: ".."
       relative: true
     source: path
-    version: "0.5.0-dev.0"
+    version: "0.5.0"
   js:
     dependency: transitive
     description:
diff --git a/pkgs/jni/lib/jni_symbols.yaml b/pkgs/jni/lib/jni_symbols.yaml
index 199df29..8b1f9ec 100644
--- a/pkgs/jni/lib/jni_symbols.yaml
+++ b/pkgs/jni/lib/jni_symbols.yaml
@@ -9,4 +9,65 @@
       name: JString
       type_class: JStringType
       super_count: 1
-
+    'java.lang.Number':
+      name: JNumber
+      type_class: JNumberType
+      super_count: 1
+    'java.lang.Byte':
+      name: JByte
+      type_class: JByteType
+      super_count: 2
+    'java.lang.Short':
+      name: JShort
+      type_class: JShortType
+      super_count: 2
+    'java.lang.Integer':
+      name: JInteger
+      type_class: JIntegerType
+      super_count: 2
+    'java.lang.Long':
+      name: JLong
+      type_class: JLongType
+      super_count: 2
+    'java.lang.Float':
+      name: JFloat
+      type_class: JFloatType
+      super_count: 2
+    'java.lang.Double':
+      name: JDouble
+      type_class: JDoubleType
+      super_count: 2
+    'java.lang.Boolean':
+      name: JBoolean
+      type_class: JBooleanType
+      super_count: 1
+    'java.util.Set':
+      name: JSet
+      type_class: JSetType
+      super_count: 1
+      type_params:
+        E:
+          'java.lang.Object': DECLARED
+    'java.util.List':
+      name: JList
+      type_class: JListType
+      super_count: 1
+      type_params:
+        E:
+          'java.lang.Object': DECLARED
+    'java.util.Iterator':
+      name: JIterator
+      type_class: JIteratorType
+      super_count: 1
+      type_params:
+        E:
+          'java.lang.Object': DECLARED
+    'java.util.Map':
+      name: JMap
+      type_class: JMapType
+      super_count: 1
+      type_params:
+        K:
+          'java.lang.Object': DECLARED
+        V:
+          'java.lang.Object': DECLARED
diff --git a/pkgs/jni/pubspec.yaml b/pkgs/jni/pubspec.yaml
index 6a999b6..4de344f 100644
--- a/pkgs/jni/pubspec.yaml
+++ b/pkgs/jni/pubspec.yaml
@@ -1,6 +1,6 @@
 name: jni
 description: Library to access JNI from dart and flutter
-version: 0.5.0-dev.0
+version: 0.5.0
 repository: https://github.com/dart-lang/jnigen/tree/main/jni
 
 environment:
diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md
index 58fb5be..4b7ca8e 100644
--- a/pkgs/jnigen/CHANGELOG.md
+++ b/pkgs/jnigen/CHANGELOG.md
@@ -1,5 +1,6 @@
-## 0.5.0-dev.0
+## 0.5.0
 * **Breaking Change** ([#72](https://github.com/dart-lang/jnigen/issues/72)): Removed support for `importMap` in favor of the newly added interop mechanism with importing yaml files.
+* **Breaking Change** ([#72](https://github.com/dart-lang/jnigen/issues/72)): `java.util.Set`, `java.util.Map`, `java.util.List`, `java.util.Iterator` and the boxed types like `java.lang.Integer`, `java.lang.Double`, ... will be generated as their corresponding classes in `package:jni`.
 * Strings now use UTF16.
 
 ## 0.4.0
diff --git a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
index 50e1e76..77ffac7 100644
--- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
+++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
@@ -1201,7 +1201,7 @@
   ///                                      be used instead.
   EmojiCompat_Config setUseEmojiAsDefaultStyle1(
     bool useEmojiAsDefaultStyle,
-    jni.JObject emojiAsDefaultStyleExceptions,
+    jni.JList<jni.JInteger> emojiAsDefaultStyleExceptions,
   ) {
     return const $EmojiCompat_ConfigType().fromRef(_setUseEmojiAsDefaultStyle1(
             reference,
@@ -2094,14 +2094,15 @@
 
   /// from: public java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int flags)
   /// The returned object must be deleted after use, by calling the `delete` method.
-  jni.JObject queryIntentContentProviders(
+  jni.JList<jni.JObject> queryIntentContentProviders(
     jni.JObject packageManager,
     jni.JObject intent,
     int flags,
   ) {
-    return const jni.JObjectType().fromRef(_queryIntentContentProviders(
-            reference, packageManager.reference, intent.reference, flags)
-        .object);
+    return const jni.JListType(jni.JObjectType()).fromRef(
+        _queryIntentContentProviders(
+                reference, packageManager.reference, intent.reference, flags)
+            .object);
   }
 
   static final _getProviderInfo = jniLookup<
@@ -2227,14 +2228,15 @@
   /// The returned object must be deleted after use, by calling the `delete` method.
   ///
   /// Get the content provider by intent.
-  jni.JObject queryIntentContentProviders(
+  jni.JList<jni.JObject> queryIntentContentProviders(
     jni.JObject packageManager,
     jni.JObject intent,
     int flags,
   ) {
-    return const jni.JObjectType().fromRef(_queryIntentContentProviders(
-            reference, packageManager.reference, intent.reference, flags)
-        .object);
+    return const jni.JListType(jni.JObjectType()).fromRef(
+        _queryIntentContentProviders(
+                reference, packageManager.reference, intent.reference, flags)
+            .object);
   }
 
   static final _getProviderInfo = jniLookup<
@@ -2686,8 +2688,8 @@
 
   /// from: static public java.util.List getFingerprintedPartitions()
   /// The returned object must be deleted after use, by calling the `delete` method.
-  static jni.JObject getFingerprintedPartitions() {
-    return const jni.JObjectType()
+  static jni.JList<jni.JObject> getFingerprintedPartitions() {
+    return const jni.JListType(jni.JObjectType())
         .fromRef(_getFingerprintedPartitions().object);
   }
 
@@ -2806,10 +2808,16 @@
   /// from: public void <init>(java.util.Map map)
   /// The returned object must be deleted after use, by calling the `delete` method.
   factory HashMap.ctor3(
-    jni.JObject map, {
-    required jni.JObjType<$K> K,
-    required jni.JObjType<$V> V,
+    jni.JMap<$K, $V> map, {
+    jni.JObjType<$K>? K,
+    jni.JObjType<$V>? V,
   }) {
+    K ??= jni.lowestCommonSuperType([
+      (map.$type as jni.JMapType).K,
+    ]) as jni.JObjType<$K>;
+    V ??= jni.lowestCommonSuperType([
+      (map.$type as jni.JMapType).V,
+    ]) as jni.JObjType<$V>;
     return HashMap.fromRef(K, V, _ctor3(map.reference).object);
   }
 
@@ -2895,7 +2903,7 @@
 
   /// from: public void putAll(java.util.Map map)
   void putAll(
-    jni.JObject map,
+    jni.JMap<$K, $V> map,
   ) {
     return _putAll(reference, map.reference).check();
   }
@@ -2948,8 +2956,8 @@
 
   /// from: public java.util.Set keySet()
   /// The returned object must be deleted after use, by calling the `delete` method.
-  jni.JObject keySet() {
-    return const jni.JObjectType().fromRef(_keySet(reference).object);
+  jni.JSet<$K> keySet() {
+    return jni.JSetType(K).fromRef(_keySet(reference).object);
   }
 
   static final _values = jniLookup<
@@ -2971,8 +2979,9 @@
 
   /// from: public java.util.Set entrySet()
   /// The returned object must be deleted after use, by calling the `delete` method.
-  jni.JObject entrySet() {
-    return const jni.JObjectType().fromRef(_entrySet(reference).object);
+  jni.JSet<jni.JObject> entrySet() {
+    return const jni.JSetType(jni.JObjectType())
+        .fromRef(_entrySet(reference).object);
   }
 
   static final _getOrDefault = jniLookup<
diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart
index 25d1146..614a23f 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart
+++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart
@@ -315,7 +315,7 @@
   ///@deprecated The method is misleading, because only one signature may be
   /// added in a document. The method will be removed in the future.
   void addSignatureField(
-    jni.JObject sigFields,
+    jni.JList<jni.JObject> sigFields,
     jni.JObject signatureInterface,
     jni.JObject options,
   ) {
@@ -553,8 +553,8 @@
   /// Retrieve all signature fields from the document.
   ///@return a <code>List</code> of <code>PDSignatureField</code>s
   ///@throws IOException if no document catalog can be found.
-  jni.JObject getSignatureFields() {
-    return const jni.JObjectType()
+  jni.JList<jni.JObject> getSignatureFields() {
+    return const jni.JListType(jni.JObjectType())
         .fromRef(_getSignatureFields(reference).object);
   }
 
@@ -570,8 +570,8 @@
   /// Retrieve all signature dictionaries from the document.
   ///@return a <code>List</code> of <code>PDSignatureField</code>s
   ///@throws IOException if no document catalog can be found.
-  jni.JObject getSignatureDictionaries() {
-    return const jni.JObjectType()
+  jni.JList<jni.JObject> getSignatureDictionaries() {
+    return const jni.JListType(jni.JObjectType())
         .fromRef(_getSignatureDictionaries(reference).object);
   }
 
@@ -1206,7 +1206,7 @@
   ///@throws IllegalStateException if the document was not loaded from a file or a stream.
   void saveIncremental1(
     jni.JObject output,
-    jni.JObject objectsToWrite,
+    jni.JSet<jni.JObject> objectsToWrite,
   ) {
     return _saveIncremental1(
             reference, output.reference, objectsToWrite.reference)
@@ -1422,8 +1422,8 @@
   ///
   /// Provides the document ID.
   ///@return the document ID
-  jni.JObject getDocumentId() {
-    return const jni.JObjectType().fromRef(_getDocumentId(reference).object);
+  jni.JLong getDocumentId() {
+    return const jni.JLongType().fromRef(_getDocumentId(reference).object);
   }
 
   static final _setDocumentId = jniLookup<
@@ -1439,7 +1439,7 @@
   /// Sets the document ID to the given value.
   ///@param docId the new document ID
   void setDocumentId(
-    jni.JObject docId,
+    jni.JLong docId,
   ) {
     return _setDocumentId(reference, docId.reference).check();
   }
diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart
index 0b23541..657f68a 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart
+++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart
@@ -422,8 +422,9 @@
   /// This will get the keys of all metadata information fields for the document.
   ///@return all metadata key strings.
   ///@since Apache PDFBox 1.3.0
-  jni.JObject getMetadataKeys() {
-    return const jni.JObjectType().fromRef(_getMetadataKeys(reference).object);
+  jni.JSet<jni.JString> getMetadataKeys() {
+    return const jni.JSetType(jni.JStringType())
+        .fromRef(_getMetadataKeys(reference).object);
   }
 
   static final _getCustomMetadataValue = jniLookup<
diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart
index 1ae50f7..9d6fe3a 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart
+++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart
@@ -493,7 +493,7 @@
   ///@throws IOException If there is an error when writing the text.
   void writeString(
     jni.JString text,
-    jni.JObject textPositions,
+    jni.JList<jni.JObject> textPositions,
   ) {
     return _writeString(reference, text.reference, textPositions.reference)
         .check();
@@ -726,8 +726,8 @@
   /// Character strings are grouped by articles. It is quite common that there will only be a single article. This
   /// returns a List that contains List objects, the inner lists will contain TextPosition objects.
   ///@return A double List of TextPositions for all text strings on the page.
-  jni.JObject getCharactersByArticle() {
-    return const jni.JObjectType()
+  jni.JList<jni.JList<jni.JObject>> getCharactersByArticle() {
+    return const jni.JListType(jni.JListType(jni.JObjectType()))
         .fromRef(_getCharactersByArticle(reference).object);
   }
 
@@ -1331,7 +1331,7 @@
   /// use to supply a different set of regular expression patterns for matching list item starts.
   ///@param patterns list of patterns
   void setListItemPatterns(
-    jni.JObject patterns,
+    jni.JList<jni.JObject> patterns,
   ) {
     return _setListItemPatterns(reference, patterns.reference).check();
   }
@@ -1361,8 +1361,8 @@
   ///
   /// This method returns a list of such regular expression Patterns.
   ///@return a list of Pattern objects.
-  jni.JObject getListItemPatterns() {
-    return const jni.JObjectType()
+  jni.JList<jni.JObject> getListItemPatterns() {
+    return const jni.JListType(jni.JObjectType())
         .fromRef(_getListItemPatterns(reference).object);
   }
 
@@ -1389,7 +1389,7 @@
   ///@return matching pattern
   static jni.JObject matchPattern(
     jni.JString string,
-    jni.JObject patterns,
+    jni.JList<jni.JObject> patterns,
   ) {
     return const jni.JObjectType()
         .fromRef(_matchPattern(string.reference, patterns.reference).object);
diff --git a/pkgs/jnigen/lib/src/config/config_types.dart b/pkgs/jnigen/lib/src/config/config_types.dart
index e74718c..2c659a0 100644
--- a/pkgs/jnigen/lib/src/config/config_types.dart
+++ b/pkgs/jnigen/lib/src/config/config_types.dart
@@ -402,7 +402,8 @@
             ..path = '$importPath/$filePath'
             ..finalName = decl['name']
             ..typeClassName = decl['type_class']
-            ..superCount = decl['super_count'];
+            ..superCount = decl['super_count']
+            ..allTypeParams = [];
           for (final typeParamEntry
               in ((decl['type_params'] as YamlMap?)?.entries) ??
                   <MapEntry<dynamic, dynamic>>[]) {
diff --git a/pkgs/jnigen/pubspec.yaml b/pkgs/jnigen/pubspec.yaml
index a76d658..65b523b 100644
--- a/pkgs/jnigen/pubspec.yaml
+++ b/pkgs/jnigen/pubspec.yaml
@@ -3,7 +3,7 @@
 # BSD-style license that can be found in the LICENSE file.
 
 name: jnigen
-version: 0.5.0-dev.0
+version: 0.5.0
 description: Experimental generator for FFI+JNI bindings.
 repository: https://github.com/dart-lang/jnigen/tree/main/jnigen
 
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart
index 562f0dd..1c60902 100644
--- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart
+++ b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart
@@ -1101,8 +1101,9 @@
   ///   token parser advanced to; or {@code null} if next token is of some other type
   ///@throws IOException for low-level read issues, or
   ///   JsonParseException for decoding problems
-  jni.JObject nextBooleanValue() {
-    return const jni.JObjectType().fromRef(_nextBooleanValue(reference).object);
+  jni.JBoolean nextBooleanValue() {
+    return const jni.JBooleanType()
+        .fromRef(_nextBooleanValue(reference).object);
   }
 
   static final _skipChildren = jniLookup<
@@ -1681,8 +1682,8 @@
   ///    the current token is not numeric, or if decoding of the value fails
   ///    (invalid format for numbers); plain IOException if underlying
   ///    content read fails (possible if values are extracted lazily)
-  jni.JObject getNumberValue() {
-    return const jni.JObjectType().fromRef(_getNumberValue(reference).object);
+  jni.JNumber getNumberValue() {
+    return const jni.JNumberType().fromRef(_getNumberValue(reference).object);
   }
 
   static final _getNumberValueExact = jniLookup<
@@ -1708,8 +1709,8 @@
   ///    (invalid format for numbers); plain IOException if underlying
   ///    content read fails (possible if values are extracted lazily)
   ///@since 2.12
-  jni.JObject getNumberValueExact() {
-    return const jni.JObjectType()
+  jni.JNumber getNumberValueExact() {
+    return const jni.JNumberType()
         .fromRef(_getNumberValueExact(reference).object);
   }
 
@@ -2573,11 +2574,11 @@
   ///@return Iterator for reading multiple Java values from content
   ///@throws IOException if there is either an underlying I/O problem or decoding
   ///    issue at format layer
-  jni.JObject readValuesAs<$T extends jni.JObject>(
+  jni.JIterator<$T> readValuesAs<$T extends jni.JObject>(
     jni.JObject valueType, {
     required jni.JObjType<$T> T,
   }) {
-    return const jni.JObjectType()
+    return jni.JIteratorType(T)
         .fromRef(_readValuesAs(reference, valueType.reference).object);
   }
 
@@ -2600,11 +2601,11 @@
   ///@return Iterator for reading multiple Java values from content
   ///@throws IOException if there is either an underlying I/O problem or decoding
   ///    issue at format layer
-  jni.JObject readValuesAs1<$T extends jni.JObject>(
+  jni.JIterator<$T> readValuesAs1<$T extends jni.JObject>(
     jni.JObject valueTypeRef, {
     required jni.JObjType<$T> T,
   }) {
-    return const jni.JObjectType()
+    return jni.JIteratorType(T)
         .fromRef(_readValuesAs1(reference, valueTypeRef.reference).object);
   }
 
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart
index 89a9aff..601b404 100644
--- a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart
+++ b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart
@@ -1046,11 +1046,10 @@
   ///   token parser advanced to; or {@code null} if next token is of some other type
   ///@throws IOException for low-level read issues, or
   ///   JsonParseException for decoding problems
-  jni.JObject nextBooleanValue() {
-    return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs(
-        reference,
-        _id_nextBooleanValue,
-        jni.JniCallType.objectType, []).object);
+  jni.JBoolean nextBooleanValue() {
+    return const jni.JBooleanType().fromRef(jni.Jni.accessors
+        .callMethodWithArgs(reference, _id_nextBooleanValue,
+            jni.JniCallType.objectType, []).object);
   }
 
   static final _id_skipChildren = jni.Jni.accessors.getMethodIDOf(
@@ -1585,8 +1584,8 @@
   ///    the current token is not numeric, or if decoding of the value fails
   ///    (invalid format for numbers); plain IOException if underlying
   ///    content read fails (possible if values are extracted lazily)
-  jni.JObject getNumberValue() {
-    return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs(
+  jni.JNumber getNumberValue() {
+    return const jni.JNumberType().fromRef(jni.Jni.accessors.callMethodWithArgs(
         reference, _id_getNumberValue, jni.JniCallType.objectType, []).object);
   }
 
@@ -1610,8 +1609,8 @@
   ///    (invalid format for numbers); plain IOException if underlying
   ///    content read fails (possible if values are extracted lazily)
   ///@since 2.12
-  jni.JObject getNumberValueExact() {
-    return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs(
+  jni.JNumber getNumberValueExact() {
+    return const jni.JNumberType().fromRef(jni.Jni.accessors.callMethodWithArgs(
         reference,
         _id_getNumberValueExact,
         jni.JniCallType.objectType, []).object);
@@ -2425,11 +2424,11 @@
   ///@return Iterator for reading multiple Java values from content
   ///@throws IOException if there is either an underlying I/O problem or decoding
   ///    issue at format layer
-  jni.JObject readValuesAs<$T extends jni.JObject>(
+  jni.JIterator<$T> readValuesAs<$T extends jni.JObject>(
     jni.JObject valueType, {
     required jni.JObjType<$T> T,
   }) {
-    return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs(
+    return jni.JIteratorType(T).fromRef(jni.Jni.accessors.callMethodWithArgs(
         reference,
         _id_readValuesAs,
         jni.JniCallType.objectType,
@@ -2452,11 +2451,11 @@
   ///@return Iterator for reading multiple Java values from content
   ///@throws IOException if there is either an underlying I/O problem or decoding
   ///    issue at format layer
-  jni.JObject readValuesAs1<$T extends jni.JObject>(
+  jni.JIterator<$T> readValuesAs1<$T extends jni.JObject>(
     jni.JObject valueTypeRef, {
     required jni.JObjType<$T> T,
   }) {
-    return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs(
+    return jni.JIteratorType(T).fromRef(jni.Jni.accessors.callMethodWithArgs(
         reference,
         _id_readValuesAs1,
         jni.JniCallType.objectType,
diff --git a/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart
index 70e0d71..5cdec37 100644
--- a/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart
+++ b/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart
@@ -949,12 +949,12 @@
 
   /// from: public java.lang.Integer i
   /// The returned object must be deleted after use, by calling the `delete` method.
-  jni.JObject get i =>
-      const jni.JObjectType().fromRef(_get_i(reference).object);
+  jni.JInteger get i =>
+      const jni.JIntegerType().fromRef(_get_i(reference).object);
 
   /// from: public java.lang.Integer i
   /// The returned object must be deleted after use, by calling the `delete` method.
-  set i(jni.JObject value) => _set_i(reference, value.reference).check();
+  set i(jni.JInteger value) => _set_i(reference, value.reference).check();
 
   static final _get_trillion = jniLookup<
           ffi.NativeFunction<
diff --git a/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart
index 24b9657..76effbb 100644
--- a/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart
+++ b/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart
@@ -893,13 +893,13 @@
 
   /// from: public java.lang.Integer i
   /// The returned object must be deleted after use, by calling the `delete` method.
-  jni.JObject get i => const jni.JObjectType().fromRef(jni.Jni.accessors
+  jni.JInteger get i => const jni.JIntegerType().fromRef(jni.Jni.accessors
       .getField(reference, _id_i, jni.JniCallType.objectType)
       .object);
 
   /// from: public java.lang.Integer i
   /// The returned object must be deleted after use, by calling the `delete` method.
-  set i(jni.JObject value) =>
+  set i(jni.JInteger value) =>
       jni.Jni.env.SetObjectField(reference, _id_i, value.reference);
 
   static final _id_trillion = jni.Jni.accessors.getFieldIDOf(