Following online discussion:
These lines from the GarbageCollectorSpec show we create a small local Spark inside a test environment. These can go inside a setup / @Before block. (We'll probably need to translate them to Java, but it's the same thing in any language).