batchUpdate2.put(COLUMN_FAMILY_STR,one);
table.commit(batchUpdate);
table.commit(batchUpdate2);
RowResult result = null;
// Test before first that null is returned
result = table.getClosestRowBefore(beforeFirstRow, columnFamilyBytes);
assertTrue(result == null);
// Test at first that first is returned
result = table.getClosestRowBefore(firstRow, columnFamilyBytes);
assertTrue(result.containsKey(COLUMN_FAMILY_STR));
assertTrue(Bytes.equals(result.get(COLUMN_FAMILY_STR).getValue(), zero));
// Test inbetween first and second that first is returned
result = table.getClosestRowBefore(beforeSecondRow, columnFamilyBytes);
assertTrue(result.containsKey(COLUMN_FAMILY_STR));
assertTrue(Bytes.equals(result.get(COLUMN_FAMILY_STR).getValue(), zero));
// Test at second make sure second is returned
result = table.getClosestRowBefore(row, columnFamilyBytes);
assertTrue(result.containsKey(COLUMN_FAMILY_STR));
assertTrue(Bytes.equals(result.get(COLUMN_FAMILY_STR).getValue(), one));
// Test after second, make sure second is returned
result = table.getClosestRowBefore(Bytes.add(row,one), columnFamilyBytes);
assertTrue(result.containsKey(COLUMN_FAMILY_STR));
assertTrue(Bytes.equals(result.get(COLUMN_FAMILY_STR).getValue(), one));
}