Fix off-by-one regression in AbstractMethodMockingControl

Issue: SPR-11385, SPR-10885
(cherry picked from commits 69a89b1 and 3a89bc4)