@Test public void testMergeQuestions2() { Multimap<String, String> sourceMap = HashMultimap.create(); sourceMap.put("sourceQuestion", "sourcequestionvalue1"); sourceMap.put("sourceQuestion", "sourcequestionvalue2"); Map<String, String> destMap = new HashMap<>(); LoadQuestionAnswerElement ae = new LoadQuestionAnswerElement(); Client.mergeQuestions(sourceMap, destMap, ae); assertEquals(Collections.singleton("sourceQuestion"), ae.getReplaced()); assertEquals(Collections.singleton("sourceQuestion"), ae.getAdded()); assertEquals(2, ae.getNumLoaded()); }
static void mergeQuestions( Multimap<String, String> sourceMap, Map<String, String> destinationMap, LoadQuestionAnswerElement ae) { for (String questionName : sourceMap.keySet()) { sourceMap .get(questionName) .forEach( questionContent -> updateLoadedQuestionsInfo(questionName, questionContent, destinationMap, ae)); } }
Client extends AbstractClient implements IClient { static void mergeQuestions( Multimap<String, String> sourceMap, Map<String, String> destinationMap, LoadQuestionAnswerElement ae) { for (String questionName : sourceMap.keySet()) { sourceMap .get(questionName) .forEach( questionContent -> updateLoadedQuestionsInfo(questionName, questionContent, destinationMap, ae)); } } }
Client extends AbstractClient implements IClient { static void mergeQuestions( Multimap<String, String> sourceMap, Map<String, String> destinationMap, LoadQuestionAnswerElement ae) { for (String questionName : sourceMap.keySet()) { sourceMap .get(questionName) .forEach( questionContent -> updateLoadedQuestionsInfo(questionName, questionContent, destinationMap, ae)); } } Client(Settings settings);  Client(String[] args); }
Client extends AbstractClient implements IClient { static void mergeQuestions( Multimap<String, String> sourceMap, Map<String, String> destinationMap, LoadQuestionAnswerElement ae) { for (String questionName : sourceMap.keySet()) { sourceMap .get(questionName) .forEach( questionContent -> updateLoadedQuestionsInfo(questionName, questionContent, destinationMap, ae)); } } Client(Settings settings);  Client(String[] args); @Override BatfishLogger getLogger(); Settings getSettings(); void run(List<String> initialCommands); }
Client extends AbstractClient implements IClient { static void mergeQuestions( Multimap<String, String> sourceMap, Map<String, String> destinationMap, LoadQuestionAnswerElement ae) { for (String questionName : sourceMap.keySet()) { sourceMap .get(questionName) .forEach( questionContent -> updateLoadedQuestionsInfo(questionName, questionContent, destinationMap, ae)); } } Client(Settings settings);  Client(String[] args); @Override BatfishLogger getLogger(); Settings getSettings(); void run(List<String> initialCommands);  }