ColumnFilter columnFilter = new ColumnFilter();
columnFilter.setFilterType(type);
columnFilter.setValue("123");
columnFilter.setColumnAlias(alias);
DoubleComparator expectedComp = new DoubleComparator(123, 0, -1);
SingleColumnValueFilter expectedFilter = new SingleColumnValueFilter(
Bytes.toBytes("cf"), Bytes.toBytes("qualifier"),
CompareOp.GREATER_OR_EQUAL, expectedComp);
expectedFilter.setFilterIfMissing(true);
SingleColumnValueFilter filterReturned = (SingleColumnValueFilter) HBaseFilterFactory
.getColumnFilter(columnFilter);
DoubleComparator returnedComparator = (DoubleComparator) filterReturned
.getComparator();
assertTrue(Bytes.compareTo(expectedComp.getValue(),
returnedComparator.getValue()) == 0);
assertTrue(Bytes.compareTo(expectedFilter.getFamily(),
filterReturned.getFamily()) == 0);
assertTrue(Bytes.compareTo(expectedFilter.getQualifier(),
filterReturned.getQualifier()) == 0);
assertTrue(filterReturned.getFilterIfMissing());
assertEquals(expectedFilter.getOperator(), filterReturned.getOperator());
assertEquals(expectedComp.getLength(), returnedComparator.getLength());
assertEquals(expectedComp.getOffset(), returnedComparator.getOffset());
}