Mock object can be a great tool if used properly. But when the test double has invariants to be respected, mocking isn't most effective at this kind of job. Mocking or stubbing getParameterMap() ...