### Question:
BookContainerHandler extends InMemoryContainerHandler { public BookHandler bookHandler() { if(this.handler==null) { throw new IllegalStateException("Handler not initialized yet"); } return this.handler; } BookContainerHandler(); void setBookHandler(BookHandler handler); BookHandler bookHandler(); @Override ResourceSnapshot create(ContainerSnapshot container, DataSet representation, WriteSession session); static final String INSERTED_CONTENT_RELATION; static final String ID; }### Answer:
@Test public void testGetHandler$failure() { BookContainerHandler containerHandler = new BookContainerHandler(); try { containerHandler.bookHandler(); fail("Should fail if no book handler is available"); } catch(IllegalStateException e) { } }