Needs to be >= or because inventory.getItem(inventory.getSize()) will throw an out of bounds exception.