Java: Merging two json objects together with primary key
Lets say I have two arrays of JSONObjects in memory and each object has a key that is similar in both arrays: Array 1 [ { "name": "Big Melons Co.", "location": "Inner City Dubai" "id": "1A" }, { "name": "Pear Flavored Juices Ltd", "location": "Seychelles" "id": "2A" }, { "name": "Squeeze My Lemons LLC", "location": "UK" "id": "3A" }, {other JSON Objects...} ] Array 2 [ { "acceptsCard": "true" "id": "1A" }, { "acceptsCard": "false" "id": "2A" }, { "acceptsCard": "false" "id": "3A" }, {other JSON Objects...} ] Now, I want to merge the two arrays together based on the primary key of "id" so they