MultiPassGroupingCallBack extends GroupingCallBack<T> { @Override public void onRemoveMerge(Record record) { RichRecord richRecord = (RichRecord) record; if (richRecord.isMerged()) { richRecord.setGroupQuality(0); } richRecord.setMerged(false); richRecord.setMaster(false); } MultiPassGroupingCallBack(BidiMultiMap oldGID2New, AbstractRecordGrouping<T> recordGrouping,
            Map<String, List<List<DQAttribute<?>>>> groupRows); @Override void onDifferent(Record record1, Record record2, MatchResult matchResult); @Override void onEndRecord(Record record); void setGIDindex(int index); int getIndexGID(); int getIndexGQ(); @Override void onMatch(Record record1, Record record2, MatchResult matchResult); @Override void onRemoveMerge(Record record); @Override void onNewMerge(Record record); @Override void onSynResult(Record newRecord, Record originalRecord, MatchResult matchResult);  }
@Test public void testOnRemoveMerge() { MultiPassGroupingCallBack<Object> mPGroupingCallBack = new MultiPassGroupingCallBack<>(oldGID2New, recordGrouping, groupRows); RichRecord record1 = new RichRecord("id1", new Date().getTime(), "source1"); record1.setOriginRow(new ArrayList<DQAttribute<?>>()); record1.setGroupQuality(1.0); record1.setMerged(true); record1.setMaster(true); mPGroupingCallBack.onRemoveMerge(record1); Assert.assertNotNull("The OriginRow of record1 should not be null", record1.getOriginRow()); Assert.assertEquals("The GroupQuality of record1 should be 0.0", "0.0", "" + record1.getGroupQuality()); Assert.assertEquals("The GroupQuality of record1 should be false", false, record1.isMaster()); Assert.assertEquals("The GroupQuality of record1 should be false", false, record1.isMerged()); record1 = new RichRecord("id1", new Date().getTime(), "source1"); record1.setOriginRow(new ArrayList<DQAttribute<?>>()); record1.setGroupQuality(1.0); record1.setMerged(false); record1.setMaster(true); mPGroupingCallBack.onRemoveMerge(record1); Assert.assertNotNull("The OriginRow of record1 should not be null", record1.getOriginRow()); Assert.assertEquals("The GroupQuality of record1 should be 0.0", "1.0", "" + record1.getGroupQuality()); Assert.assertEquals("The GroupQuality of record1 should be false", false, record1.isMaster()); Assert.assertEquals("The GroupQuality of record1 should be false", false, record1.isMerged()); }