Code example for ReferenceQueue

Methods: pollremove

0
        rt.start();
        try { 
            Thread.sleep(10);
        } catch(InterruptedException ie) {
             
        } 
        rt.interrupt();
        try { 
            Thread.sleep(10);
        } catch(InterruptedException ie) {
             
        }         
        assertTrue(isThrown);
        assertNull(rq.poll());
         
        try { 
            rq.remove(-1);
            fail("IllegalArgumentException expected.");
        } catch(IllegalArgumentException iae) {
            //expected 
Contextual code suggestions in your IDE  Get Codota for Java