### Question:
PipelineStateManager { Pipeline removePipeline(PipelineID pipelineID) throws IOException { Pipeline pipeline = pipelineStateMap.removePipeline(pipelineID); LOG.info("Pipeline {} removed from db", pipeline); return pipeline; } PipelineStateManager(); void addPipeline(Pipeline pipeline); List<Pipeline> getPipelines(); void activatePipeline(PipelineID pipelineID); void deactivatePipeline(PipelineID pipelineID); void updatePipelineState(PipelineID id, PipelineState newState);  }### Answer:
@Test public void testRemovePipeline() throws IOException { Pipeline pipeline = createDummyPipeline(1); stateManager.addPipeline(pipeline); stateManager.openPipeline(pipeline.getId()); stateManager .addContainerToPipeline(pipeline.getId(), ContainerID.valueof(1)); try { stateManager.removePipeline(pipeline.getId()); Assert.fail("Pipeline should not have been removed"); } catch (IOException e) { Assert.assertTrue(e.getMessage().contains("not yet closed")); } stateManager.finalizePipeline(pipeline.getId()); removePipeline(pipeline); }