This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
That is, by itself it can't. Of course you might be able to write a JUnit test that can figure out whether there was a memory leak but then it's not really JUnit doing it... (you could try a very primitive--and somewhat unreliable--analysis with totalMemory() and freeMemory() from the java.lang.Runtime class)
Or you could just use a profiling tool that can detect memory leaks. I haven't used one for finding memory leak in a while but at least OptimizeIT and JProbe advertize memory leak detection in their feature lists. JProfiler might also help in locating the leaks.