diff --git a/lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java b/lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java index 5efe13ca6714..8e8d27a185f1 100644 --- a/lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/util/hnsw/HnswGraphTestCase.java @@ -242,7 +242,7 @@ public void testReadWrite() throws IOException { IndexWriterConfig iwc = new IndexWriterConfig() .setCodec( - TestUtil.alwaysKnnVectorsFormat(new Lucene99HnswVectorsFormat(M, beamWidth))); + TestUtil.alwaysKnnVectorsFormat(new Lucene99HnswVectorsFormat(M, beamWidth, 0))); try (IndexWriter iw = new IndexWriter(dir, iwc)) { KnnVectorValues.DocIndexIterator it2 = v2.iterator(); while (it2.nextDoc() != NO_MORE_DOCS) { @@ -271,9 +271,7 @@ public void testReadWrite() throws IOException { ((Lucene99HnswVectorsReader) ((CodecReader) ctx.reader()).getVectorReader().unwrapReaderForField("field")) .getGraph("field"); - if (graphValues.size() > 0) { - assertGraphEqual(hnsw, graphValues); - } + assertGraphEqual(hnsw, graphValues); } } }