In JUnit4-style tests, you can assign variables where they are defined. JUnit4 won't create an instance of the class until just before it is run, and it will make it eligible for garbage collection right after it is run.