HandlerParameter { public void removeFromConflictList(Integer index, String realColName) { if (dataset == null) { return; } DataSet originalSet = dataset; if (originalSet instanceof SubDataSet) { originalSet = ((SubDataSet) originalSet).getOrignialDataSet(); } List<HashSet<String>> conflictList = originalSet.getConflictList(); if (conflictList.size() > 0) { originalSet.getConflictList().get(index).remove(realColName); } } HandlerParameter(DataSet dataset, Column referenceColumn, Column targetColumn, String ruleName,
            Map<String, Integer> columnIndexMap, String fillColumn, FunctionParameter funcParam); Object getRefInputData(Object[] inputData); Object getTarInputData(Object[] inputDatas); DataSet getDataset(); ISurvivorshipAction getAction(); Column getReferenceColumn(); Column getTargetColumn(); String getRuleName(); String getExpression(); boolean isIgnoreBlank(); void setDataset(DataSet dataset); void setRefColumn(Column refColumn); void setTarColumn(Column tarColumn); void setRuleName(String ruleName); Map<String, Integer> getColumnIndexMap(); boolean isConflictRow(Integer rowNum); List<Integer> getConflictDataIndexList(); void updateDataSet(); void addConfDataIndex(Integer index); Object getInputData(Integer index, String columnName); void setFillColumn(String fillColumn); String getFillColumn(); boolean isRemoveDuplicate(); Function getFunction(); void removeFromConflictList(Integer index, String realColName);  }
@Test public void testRemoveFromConflictList() { Column col1 = new Column("city1", "String"); Column col2 = new Column("city2", "String"); List<Column> columns = new ArrayList<>(); columns.add(col1); columns.add(col2); DataSet dataset = new DataSet(columns); Record record1 = new Record(); record1.setId(1); Attribute att1 = new Attribute(record1, col1, "value1"); Attribute att2 = new Attribute(record1, col2, "value2"); record1.putAttribute("city1", att1); record1.putAttribute("city2", att2); col1.putAttribute(record1, att1); col2.putAttribute(record1, att2); dataset.getRecordList().add(record1); record1 = new Record(); record1.setId(2); att1 = new Attribute(record1, col1, "value3"); att2 = new Attribute(record1, col2, "value4"); record1.putAttribute("city1", att1); record1.putAttribute("city2", att2); col1.putAttribute(record1, att1); col2.putAttribute(record1, att2); dataset.getRecordList().add(record1); List<Integer> conflictRowNum = new ArrayList<>(); conflictRowNum.add(0); dataset.getConflictDataMap().get().put("city2", conflictRowNum); ISurvivorshipAction action = RuleDefinition.Function.MostCommon.getAction(); Column refColumn = col1; Column tarColumn = col2; String ruleName = "rule1"; String expression = null; boolean isIgnoreBlank = false; String fillColumn = "city2"; boolean isDealDup = false; Map<String, Integer> columnIndexMap = new HashMap<>(); columnIndexMap.put("city1", 0); columnIndexMap.put("city2", 1); FunctionParameter functionParameter = new FunctionParameter(action, expression, isIgnoreBlank, isDealDup); List<HashSet<String>> conflictList = dataset.getConflictList(); HashSet hashSet = new HashSet(); hashSet.add("city1"); hashSet.add("city2"); conflictList.add(hashSet); hashSet = new HashSet(); hashSet.add("city1"); hashSet.add("city2"); conflictList.add(hashSet); HandlerParameter handlerParameter = new HandlerParameter(dataset, refColumn, tarColumn, ruleName, columnIndexMap, fillColumn, functionParameter); handlerParameter.removeFromConflictList(0, "city1"); handlerParameter.removeFromConflictList(1, "city2"); Assert.assertEquals("The size of conflict list should be 1", 1, conflictList.get(0).size()); Assert.assertEquals("The size of conflict list should be 1", 1, conflictList.get(1).size()); String conflictColumnForFirstRecored = conflictList.get(0).iterator().next(); String conflictColumnForSecondRecored = conflictList.get(1).iterator().next(); Assert.assertEquals("The conflict column in first record should be city2", "city2", conflictColumnForFirstRecored); Assert.assertEquals("The conflict column in second record should be city1", "city1", conflictColumnForSecondRecored); }