* java.lang.ref.ReferenceQueue)
*/
public void test_ConstructorLjava_lang_ObjectLjava_lang_ref_ReferenceQueue() throws Exception {
ReferenceQueue rq = new ReferenceQueue();
bool = new Boolean(true);
PhantomReference pr = new PhantomReference(bool, rq);
// Allow the finalizer to run to potentially enqueue
Thread.sleep(1000);
assertTrue("Initialization failed.", !pr.isEnqueued());
// need a reference to bool so the jit does not optimize it away
assertTrue("should always pass", bool.booleanValue());
boolean exception = false;
try {
new PhantomReference(bool, null);
} catch (NullPointerException e) {
exception = true;
}
assertTrue("Should not throw NullPointerException", !exception);
}