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());
}
}