### Question:
ServiceImpl implements Service { @Override public String storeData(Results workflowResults, String wfId, long timer, String demId) { try { Inputs in = new Inputs(workflowResults, wfId, timer, demId, 0l); checkInputs(in); init(in); long workflowProcessingTime = getCurrentTimestamp() - timer; in.executionTime = workflowProcessingTime; Results fileLists = new Results(); Results logLists = new Results(); Results xmlEvalLists = new Results(); Results layoutEvalLists = new Results(); Results wordEvalLists = new Results(); splitResults(in, fileLists, logLists, xmlEvalLists, layoutEvalLists, wordEvalLists); saveFiles(fileLists); saveToolLogs(logLists); saveReport(in, logLists, xmlEvalLists, layoutEvalLists, wordEvalLists); saveOwnLog(); } catch (RuntimeException e) { clearThreadLocals(); return "An error occurred:" + formatException(e); } String status = getStatusMessage(); clearThreadLocals(); return status; }  @Override String storeData(Results workflowResults, String wfId, long timer,
			String demId);  }### Answer:
@Test public void testStoreData() { ArrayList<String> resultsList = new ArrayList<String>(); resultsList.add("http: resultsList.add("http: String message = executeWithList(resultsList); assertTrue(message.indexOf("Stored results at") >= 0); assertTrue(message.indexOf(demonstratorId + "/" + workflowId + "/") >= 0); assertFalse(message.indexOf("warnings or errors") >= 0); }
@Test public void testStoreDataEmptyResults() throws MalformedURLException, IOException { String expectedError = "There were no results to be stored."; Results results = new Results(); Service ws = new ServiceImpl(); String message = ws.storeData(results, workflowId, time, demonstratorId); assertTrue(message.contains(expectedError)); message = ws.storeData(results, null, time, demonstratorId); assertTrue(message.contains(expectedError)); }