How to test an exception in the run
function?
` public void run() {
ArrayBlockingQueue<String> bookQueue =
library.getBookQueue(book);
try {
bookQueue.take();
try {
updateState(State.IN_PROGRESS);
Thread.sleep(READ_TIME_MS);
bookQueue.put(book);
updateState(State.ENDED);
} catch(InterruptedException e){
bookQueue.put(book);
}
} catch(InterruptedException e) {
Thread.currentThread().interrupt();
}
finally {
updateState(State.ENDED);
}
}`