Skip to content

Commit

Permalink
test(#901): call JsonArray.putAll with a casted list as object
Browse files Browse the repository at this point in the history
  • Loading branch information
hexetia authored Oct 5, 2024
1 parent 14f7127 commit 0d71dcf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/org/json/junit/JSONArrayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ public void verifyPutAll() {
jsonArray.length(),
len);

// collection as object
@SuppressWarnings("RedundantCast")
Object myListAsObject = (Object) myList;
jsonArray.putAll(myListAsObject);

for (int i = 0; i < myList.size(); i++) {
assertEquals("collection elements should be equal",
myList.get(i),
Expand Down

0 comments on commit 0d71dcf

Please sign in to comment.