Tests for merging item trees with costs