@Test
public void testGetPutKvs() {

  List<KeyValue> writeKvs = new ArrayList<KeyValue>();
  writeKvs.add(getPutKv(COLUMN, PREWRITE_TS));
  writeKvs.add(getDeleteKv(COLUMN, PREWRITE_TS + 1));
  writeKvs.add(getPutKv(COLUMN_WITH_ANOTHER_FAMILY, PREWRITE_TS + 1));
  writeKvs.add(getDeleteKv(COLUMN_WITH_ANOTHER_FAMILY, PREWRITE_TS));
  writeKvs.add(getDeleteKv(new ColumnCoordinate(ROW, ANOTHER_FAMILY, ANOTHER_QUALIFIER), PREWRITE_TS));
  writeKvs.add(getPutKv(COLUMN_WITH_ANOTHER_QUALIFIER, PREWRITE_TS));
  Collections.sort(writeKvs, KeyValue.COMPARATOR);
  List<KeyValue> putKvs = ThemisCpUtil.getPutKvs(writeKvs);
  Assert.assertEquals(2, putKvs.size());
  Collections.sort(putKvs, new KVComparator());
  Assert.assertTrue(getPutKv(COLUMN_WITH_ANOTHER_FAMILY, PREWRITE_TS + 1).equals(putKvs.get(0)));
  Assert.assertTrue(getPutKv(COLUMN_WITH_ANOTHER_QUALIFIER, PREWRITE_TS).equals(putKvs.get(1)));
  
  // test two different familes with different values
  writeKvs.clear();
  writeKvs.add(getPutKv(COLUMN_WITH_ANOTHER_FAMILY, PREWRITE_TS));
  writeKvs.add(getPutKv(COLUMN, PREWRITE_TS));
  Collections.sort(writeKvs, new KVComparator());
  putKvs = ThemisCpUtil.getPutKvs(writeKvs);
  Assert.assertTrue(getPutKv(COLUMN_WITH_ANOTHER_FAMILY, PREWRITE_TS).equals(putKvs.get(0)));
  Assert.assertTrue(getPutKv(COLUMN, PREWRITE_TS).equals(putKvs.get(1)));
}