[BUGFIX] Ensure that ThreadSafeArray can be mocked on JRuby