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.
SCJP 1.4, SCWCD 1.4, SCBCD 1.3
So I left, I came home, and I ate some pie. And then I read this tiny ad: