Code example for CancellationException

0
        return true; 
    } 
 
    @Override 
    public Object get() {
        throw new CancellationException();
    } 
 
    @Override 
    public Object get(long timeout, TimeUnit unit) {
        return get(); 
    } 
}