containsId() should not modify the base query

- added test case
- should fix issue #1