change the way test app waits for gc

gcSoftReferences methods are being obsoleted, so we need a different
approach to wait for gc: create a CountDownLatch and release it in
a dummy object's finalizer, call gc and await on the CDL.

Change-Id: I54d9e6bc05540b16ee1f3959ace9008041ac4903
1 file changed