Adds test for callProtectedMethod.

Also found a bug in that method. The caching wasn't doing anything
because the check for an existing instance was always returning
false. This commit also fixes that bug.