CRCRHandler extends AbstractChainOfResponsibilityHandler { @Override protected void initConflictRowNum(Map<Integer, String> preConflictRowNum) { this.conflictingRowNumbers.putAll(preConflictRowNum); } CRCRHandler(HandlerParameter handlerParameter); @Override void handleRequest(Object inputData, int rowNum); @Override void handleRequest(); @Override CRCRHandler getSuccessor(); @Override AbstractChainOfResponsibilityHandler linkSuccessor(AbstractChainOfResponsibilityHandler nextHandler); SurvivedResult getSurvivedRowNum(); boolean isValidResult(); Object getLongestResult(Object result); Object getNonDuplicatedResult(Object result); boolean isMissionCompleted();  }
@Test public void testInitConflictRowNum() { HandlerParameter handlerParameter = createHandlerParameter(null); CRCRHandler crcrHandler = new CRCRHandler(handlerParameter); Map<Integer, String> preConflictRowNum = new HashMap<>(); preConflictRowNum.put(1, "city1"); preConflictRowNum.put(2, "city1"); preConflictRowNum.put(3, "city2"); crcrHandler.initConflictRowNum(preConflictRowNum); Assert.assertEquals("the column name of record 1 should be city1", "city1", crcrHandler.conflictingRowNumbers.get(1)); Assert.assertEquals("the column name of record 2 should be city1", "city1", crcrHandler.conflictingRowNumbers.get(2)); Assert.assertEquals("the column name of record 3 should be city2", "city2", crcrHandler.conflictingRowNumbers.get(3)); }