### Question:
AlgorithmRunner { public void start(final Map<String, String> algorithmRawParams, final Callback callback) { final Map<Parameter, Object> algorithmParams = ArgumentUtils.validateParameters(algorithm, algorithmRawParams); final TextProgress progress = new TextProgress(pw); new Thread() { @Override public void run() { logger.debug("Calling algorithm run method with parameters: "+algorithmParams); result = algorithm.run(connectionModel.getSchema(), algorithmParams, progress); callback.algorithmDone(); } }.start(); } AlgorithmRunner(); void setAlgorithm(Algorithm algorithm); void start(final Map<String, String> algorithmRawParams, final Callback callback); void stop(); Result getResult(); void setConnectionModel(ConnectionModel connectionModel);  }### Answer:
@Test public void testStart() throws Exception { SchemaStub schemaStub = new SchemaStub(); ConnectionModel connectionModel = new ConnectionModelStub(schemaStub); AlgorithmStub algorithmStub = new AlgorithmStub(); AlgorithmRunner algoRunner = new AlgorithmRunner(); Map<String, String> algorithmRawParams = new HashMap<String, String>(); algoRunner.setConnectionModel(connectionModel); algoRunner.setAlgorithm(algorithmStub); algoRunner.start(algorithmRawParams, new Callback() { public void algorithmDone() { AlgorithmRunnerTest.this.algorithmDoneCalled = true; } }); Thread.sleep(5000); assertTrue("Algorithm done not called.", algorithmDoneCalled); algoRunner.stop(); assertNotNull( algoRunner.getResult() ); }