private KeyValue<K, V> nextCacheValue(final Bytes nextCacheKey) { final KeyValue<Bytes, LRUCacheEntry> next = cacheIterator.next(); if (!next.key.equals(nextCacheKey)) { throw new IllegalStateException("Next record key is not the peeked key value; this should not happen"); } return KeyValue.pair(deserializeCacheKey(next.key), deserializeCacheValue(next.value)); }