### Question:
Bootstrap implements ExternalResourceReleasable { public void setFactory(ChannelFactory factory) { if (factory == null) { throw new NullPointerException("factory"); } if (this.factory != null) { throw new IllegalStateException( "factory can't change once set."); } this.factory = factory; } protected  Bootstrap(); protected  Bootstrap(ChannelFactory channelFactory); ChannelFactory getFactory(); void setFactory(ChannelFactory factory); ChannelPipeline getPipeline(); void setPipeline(ChannelPipeline pipeline); Map<String, ChannelHandler> getPipelineAsMap(); void setPipelineAsMap(Map<String, ChannelHandler> pipelineMap); ChannelPipelineFactory getPipelineFactory(); void setPipelineFactory(ChannelPipelineFactory pipelineFactory); Map<String, Object> getOptions(); void setOptions(Map<String, Object> options); Object getOption(String key); void setOption(String key, Object value); void releaseExternalResources(); void shutdown();  }### Answer:
@Test(expected = IllegalStateException.class) public void shouldNotAllowInitialFactoryToChange() { new Bootstrap(createMock(ChannelFactory.class)).setFactory(createMock(ChannelFactory.class)); }
@Test(expected = NullPointerException.class) public void shouldNotAllowNullFactory() { newBootstrap().setFactory(null); }