diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java index 17caf084cba..5af847d8477 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java @@ -255,7 +255,7 @@ public abstract class BaseDocValuesFormatTestCase extends BaseIndexFileFormatTes HashMap writtenValues = new HashMap<>(numDocs); // Small vocabulary ranges will be highly compressible - int vocabRange = random().nextInt(Byte.MAX_VALUE); + int vocabRange = 1 + random().nextInt(Byte.MAX_VALUE - 1); for (int i = 0; i < numDocs; i++) { Document doc = new Document();