Code example for ReferenceQueue

Methods: remove

0
        } catch (IllegalArgumentException expected) {
        } 
    } 
 
    public void testRemoveWithVeryLargeTimeout() throws Exception { 
        ReferenceQueue<Object> referenceQueue = new ReferenceQueue<Object>();
        enqueueLater(referenceQueue, 500);
        referenceQueue.remove(Long.MAX_VALUE);
    } 
 
    public void testRemoveWithSpuriousNotify() throws Exception { 
        final ReferenceQueue<Object> referenceQueue = new ReferenceQueue<Object>();
 
        runLater(new Runnable() {
            @Override public void run() { 
                synchronized (referenceQueue) {
                    referenceQueue.notifyAll();
                } 
            } 
        }, 500);