JUnit 3 test runners invoke the tearDown()
method after running each test.
For example, from XOM:
protected void tearDown() {
doc = null;
System.gc();
}
Each tearDown()
method should invoke its superclass's tearDown()
method, but this is often forgotten