Test for testing study loop - patches private methods so most likely should be rewritten sometime.