Throw if an element is already contained so the unit tests don't have to check the return value every time