[BZ-1007529] fix the findEndOfMethodArgsIndex() + add several tests
Merge pull request #252 from psiroky/bz1007529

[BZ1007529] add test reproducing the issue + fix