Added assertItemsEquals function.
Created errormsg private helper function: we don't want to duplicate code.