This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
SCJP is properly a better forum for this post, but the variable is available for GC as soon as there are no more reference to it. The a inside testB is gone with the instance of testB is gone; which is the case when the instance of TestA is gone; which is the case when testAll completes. After testAll, a and b are candidates for GC.