In the previous posts we had a look at weak and soft references. The java.lang.ref package also includes a class ReferenceQueue. As per the class documentation:
Reference queues, to which registered reference objects are appended by the garbage collector after the appropriate reachability changes are detected.