When a new object is created, it is stored in the area of memory called the heap. The heap is where all objects live until they are no longer needed and are ready to be garbage collected. However, before an object can be garbage collected, all references to that object must be removed. Otherwise, the object will continue to live on in memory even though it is no longer needed. In JUnit, tests are run in separate threads. When a test is finished running, the thread that ran the test is terminated. All objects that were used by the thread are no longer needed and can be garbage collected. However, there may be other objects in memory that were not used by the thread but still reference the objects used by the thread. These objects will prevent the garbage collector from reclaiming the memory used by the thread. As a result, it is important to ensure that all references to objects used by a JUnit test are removed before terminating the thread. Otherwise, those objects will continue to live in memory even though they are no longer needed.