Bug 361804 - StaticContextAdapter returns mock function Also plugged a memory leak, where each test was retaining a lot of references to XPath engines and contexts.