@Test
public void testConvertBetweenRangeToken() {

    Text key = TestData.getText();
    Operator operator = Operator.BETWEEN;
    Value value1 = TestData.getValue();
    Value value2 = null;
    while (value2 == null || value1.equals(value2)) {
        value2 = TestData.getValue();
    }
    RangeToken token = RangeToken.forReading(key, operator,
            value1.compareTo(value2) < 0 ? value1 : value2,
            value1.compareTo(value2) > 0 ? value1 : value2);
    Range<Value> range = Iterables
            .getOnlyElement(RangeTokens.convertToRange(token));
    Assert.assertEquals(range,
            Range.closedOpen(value1.compareTo(value2) < 0 ? value1 : value2,
                    value1.compareTo(value2) > 0 ? value1 : value2));
}