Program: 29947
Project: 29947
Buggy source:
@Test public void testCreateScanWithLockAndWriteColumns() throws IOException {
  byte[] startRow=Bytes.toBytes("String_Node_Str");
  byte[] stopRow=Bytes.toBytes("String_Node_Str");
  Scan scan=new Scan(startRow,stopRow);
  scan.addColumn(FAMILY,QUALIFIER);
  scan.addColumn(ANOTHER_FAMILY,ANOTHER_QUALIFIER);
  Scan createdScan=ThemisCpUtil.constructLockAndWriteScan(scan,PREWRITE_TS);
  Assert.assertArrayEquals(startRow,createdScan.getStartRow());
  Assert.assertArrayEquals(stopRow,createdScan.getStopRow());
  Assert.assertEquals(3,createdScan.getFamilies().length);
  checkReadWithLockAndWriteColumns(createdScan.getFamilyMap(),COLUMN);
  checkReadWithLockAndWriteColumns(createdScan.getFamilyMap(),new ColumnCoordinate(ANOTHER_FAMILY,ANOTHER_QUALIFIER));
  scan=new Scan(startRow,stopRow);
  scan.addFamily(FAMILY);
  scan.addColumn(ANOTHER_FAMILY,QUALIFIER);
  createdScan=ThemisCpUtil.constructLockAndWriteScan(scan,PREWRITE_TS);
  Assert.assertArrayEquals(startRow,createdScan.getStartRow());
  Assert.assertArrayEquals(stopRow,createdScan.getStopRow());
  Assert.assertEquals(3,createdScan.getFamilies().length);
  checkReadWithWriteColumns(createdScan.getFamilyMap(),new ColumnCoordinate(ANOTHER_FAMILY,QUALIFIER));
  Assert.assertTrue(createdScan.getFamilyMap().containsKey(FAMILY) && createdScan.getFamilyMap().get(FAMILY) == null);
  Assert.assertTrue(createdScan.getFamilyMap().containsKey(ColumnUtil.LOCK_FAMILY_NAME) && createdScan.getFamilyMap().get(ColumnUtil.LOCK_FAMILY_NAME) == null);
  Assert.assertTrue(createdScan.getFilter() instanceof ExcludeDataColumnFilter);
}

Fixed version (ground truth):
@Test public void testCreateScanWithLockAndWriteColumns() throws IOException {
  byte[] startRow=Bytes.toBytes("String_Node_Str");
  byte[] stopRow=Bytes.toBytes("String_Node_Str");
  Scan scan=new Scan(startRow,stopRow);
  scan.addColumn(FAMILY,QUALIFIER);
  scan.addColumn(ANOTHER_FAMILY,ANOTHER_QUALIFIER);
  Scan createdScan=ThemisCpUtil.constructLockAndWriteScan(scan,PREWRITE_TS);
  Assert.assertArrayEquals(startRow,createdScan.getStartRow());
  Assert.assertArrayEquals(stopRow,createdScan.getStopRow());
  Assert.assertEquals(3,createdScan.getFamilies().length);
  checkReadWithLockAndWriteColumns(createdScan.getFamilyMap(),COLUMN);
  checkReadWithLockAndWriteColumns(createdScan.getFamilyMap(),new ColumnCoordinate(ANOTHER_FAMILY,ANOTHER_QUALIFIER));
  scan=new Scan(startRow,stopRow);
  scan.addFamily(ANOTHER_FAMILY);
  scan.addColumn(FAMILY,QUALIFIER);
  createdScan=ThemisCpUtil.constructLockAndWriteScan(scan,PREWRITE_TS);
  Assert.assertArrayEquals(startRow,createdScan.getStartRow());
  Assert.assertArrayEquals(stopRow,createdScan.getStopRow());
  Assert.assertEquals(3,createdScan.getFamilies().length);
  checkReadWithWriteColumns(createdScan.getFamilyMap(),new ColumnCoordinate(FAMILY,QUALIFIER));
  Assert.assertTrue(createdScan.getFamilyMap().containsKey(ANOTHER_FAMILY) && createdScan.getFamilyMap().get(ANOTHER_FAMILY) == null);
  Assert.assertTrue(createdScan.getFamilyMap().containsKey(ColumnUtil.LOCK_FAMILY_NAME) && createdScan.getFamilyMap().get(ColumnUtil.LOCK_FAMILY_NAME) == null);
  Assert.assertTrue(createdScan.getFilter() instanceof ExcludeDataColumnFilter);
}