// Try to serialize
BytesWritable bytes[] = new BytesWritable[structs.length];
for (int i=0; i<structs.length; i++) {
bytes[i] = new BytesWritable();
BytesWritable s = (BytesWritable)serde.serialize(structs[i], oi);
bytes[i].set(s);
if (i>0) {
int compareResult = bytes[i-1].compareTo(bytes[i]);
if ( (compareResult<0 && !ascending) || (compareResult>0 && ascending) ) {
System.out.println("Test failed in " + (ascending ? "ascending" : "descending") + " order.");