### Question:
AdapterWorkerManagement { public void stopStreamAdapter(AdapterStreamDescription adapterStreamDescription) throws AdapterException { stopAdapter(adapterStreamDescription); }  Collection<Protocol> getAllProtocols(); Protocol getProtocol(String id); Collection<Adapter> getAllAdapters(); Adapter getAdapter(String id); void invokeStreamAdapter(AdapterStreamDescription adapterStreamDescription); void stopStreamAdapter(AdapterStreamDescription adapterStreamDescription); void invokeSetAdapter(AdapterSetDescription adapterSetDescription); void stopSetAdapter(AdapterSetDescription adapterSetDescription);  }### Answer:
@Test public void stopStreamAdapterFail() { String expected = "Adapter with id http: AdapterStreamDescription asd = new GenericAdapterStreamDescription(); asd.setUri("http: AdapterWorkerManagement adapterManagement = new AdapterWorkerManagement(); try { adapterManagement.stopStreamAdapter(asd); fail(); } catch (AdapterException e) { assertEquals(expected, e.getMessage()); } }
@Test public void stopStreamAdapterSuccess() throws AdapterException { TestAdapter testAdapter = getTestAdapterInstance(); RunningAdapterInstances.INSTANCE.addAdapter("http: AdapterWorkerManagement adapterWorkerManagement = new AdapterWorkerManagement(); adapterWorkerManagement.stopStreamAdapter(Utils.getMinimalStreamAdapter()); assertTrue(testAdapter.calledStop); }