You could always use two array lists:
Inventory_Slot (How many objects of a given type is within this slot?)
Inventory_Type (What kind of object does this slot hold at the moment?)
When you add an object to the inventory in-game, use a loop to go through Inventory_Type from zero to 19 or whatever. Here's some pseudo-code:
(where x is the current value being looped through)
If Inventory_Type(x) = Object.Type OR Inventory_Type(x) = 0 (as in empty) --->
Inventory_Slot(x) = Inventory_Slot(x) + 1
Inventory_Type(x) = Object.Type (if the slot was empty we need to set it to the type of object added).