put.add(fam1, col3, null);
put.add(fam1, col4, null);
put.add(fam1, col5, null);
region.put(put);
Get get = new Get(row1);
get.addColumn(fam1, col2);
get.addColumn(fam1, col4);
//Expected result
KeyValue kv1 = new KeyValue(row1, fam1, col2);
KeyValue kv2 = new KeyValue(row1, fam1, col4);
KeyValue [] expected = {kv1, kv2};
//Test
Result res = region.get(get, null);
assertEquals(expected.length, res.size());
for(int i=0; i<res.size(); i++){
assertEquals(0,
Bytes.compareTo(expected[i].getRow(), res.raw()[i].getRow()));
assertEquals(0,
Bytes.compareTo(expected[i].getFamily(), res.raw()[i].getFamily()));
assertEquals(0,
Bytes.compareTo(
expected[i].getQualifier(), res.raw()[i].getQualifier()));
}
// Test using a filter on a Get
Get g = new Get(row1);
final int count = 2;
g.setFilter(new ColumnCountGetFilter(count));
res = region.get(g, null);
assertEquals(count, res.size());
}