private void verifyFind(NavigableMap<MockId, NavigableSet<IndexValue>> referenceIndex, IndexSegment segment)
      throws StoreException {
    for (Map.Entry<MockId, NavigableSet<IndexValue>> entry : referenceIndex.entrySet()) {
      NavigableSet<IndexValue> referenceValues = entry.getValue();
      NavigableSet<IndexValue> values = segment.find(entry.getKey());
      assertNotNull("Values obtained from segment is null", values);
      IndexValue valueFromSegment = values.first();
      for (IndexValue referenceValue : referenceValues) {
        assertEquals("Offset is not equal", referenceValue.getOffset(), valueFromSegment.getOffset());
        assertEquals("Value is not equal", referenceValue.getBytes(), valueFromSegment.getBytes());
        valueFromSegment = values.higher(valueFromSegment);
      }
      assertNull("There should be no more values in the segment", valueFromSegment);
    }
    // try to find a key that does not exist.
    MockId id = generateIds(referenceIndex, 1).get(0);
    assertNull("Should have failed to find non existent key", segment.find(id));
  }
Verifies {@link IndexSegment#find(StoreKey)} to make sure that it returns/does not return values.
@param referenceIndex the index entries to be used as reference.
@param segment the {@link IndexSegment} to test
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/IndexSegmentTest.java