Factor out the item handling comparisons.
Tidied.
Make these tests more robust.
More tiny cleanups. No functional change.