public void testRanges() throws Exception {
int num = atLeast(1000);
for (int i = 0; i < num; i++) {
BytesRef lowerVal = new BytesRef(_TestUtil.randomUnicodeString(random()));
BytesRef upperVal = new BytesRef(_TestUtil.randomUnicodeString(random()));
if (upperVal.compareTo(lowerVal) < 0) {
assertSame(upperVal, lowerVal, random().nextBoolean(), random().nextBoolean());
} else {
assertSame(lowerVal, upperVal, random().nextBoolean(), random().nextBoolean());
}
}