Could always just wrap the ItemStack in a class that implements hashCode and equals.
As we control adding and removing from the map could always box/unbox it.