You could store it like this.
Chest instance variable > Array.asJSON > reference to object
So you would only ever need a single Array object for chests. When you open a chest you load chest.variable into the array object. There you can manipulate it however you want (take items out/put items in) and once the chest is closed you save the array back into the chest instance variable with array.asjson.