This method assumes that {@code keyBlock} has no duplicated entries (in the specified range)
551571
static void buildHashTable(Block keyBlock, int keyOffset, int keyCount, MethodHandle keyBlockHashCode, int[] outputHashTable, int hashTableOffset, int hashTableSize)
    {
        for (int i = 0; i < keyCount; i++) {
            int hash = getHashPosition(keyBlock, keyOffset + i, keyBlockHashCode, hashTableSize);
            while (true) {
                if (outputHashTable[hashTableOffset + hash] == -1) {
                    outputHashTable[hashTableOffset + hash] = i;
                    break;
                }
                hash++;
                if (hash == hashTableSize) {
                    hash = 0;
                }
            }
        }
    }
515319
private int ensureIndex(int key, boolean intType) {
        int index = -1;
        int firstDeleted = -1;
        int[] keys = this.keys;
        if (keys != null) {
            int fraction = key * A;
            index = fraction >>> (32 - power);
            int entry = keys[index];
            if (entry == key) { return index; }
            if (entry != EMPTY) {
                if (entry == DELETED) { firstDeleted = index; }
                // Search in table after first failed attempt
                int mask = (1 << power) - 1;
                int step = tableLookupStep(fraction, mask, power);
                int n = 0;
                do {
                    if (check) {
                        if (n >= occupiedCount) Kit.codeBug();
                        ++n;
                    }
                    index = (index + step) & mask;
                    entry = keys[index];
                    if (entry == key) { return index; }
                    if (entry == DELETED && firstDeleted < 0) {
                        firstDeleted = index;
                    }
                } while (entry != EMPTY);
            }
        }
        // Inserting of new key
        if (check && keys != null && keys[index] != EMPTY)
            Kit.codeBug();
        if (firstDeleted >= 0) {
            index = firstDeleted;
        }
        else {
            // Need to consume empty entry: check occupation level
            if (keys == null || occupiedCount * 4 >= (1 << power) * 3) {
                // Too litle unused entries: rehash
                rehashTable(intType);
                return insertNewKey(key);
            }
            ++occupiedCount;
        }
        keys[index] = key;
        ++keyCount;
        return index;
    }
112486
public synchronized boolean addUnique(int key, int value) {

        if (count == capacity) {
            if (fixedSize) {
                return false;
            } else {
                doubleCapacity();
            }
        }

        if (!sorted) {
            fastQuickSort();
        }

        targetSearchValue = sortOnValues ? value
                                         : key;

        int i = binaryEmptySlotSearch();

        if (i == -1) {
            return false;
        }

        hasChanged = true;

        if (count != i) {
            moveRows(i, i + 1, count - i);
        }

        keys[i]   = key;
        values[i] = value;

        count++;

        return true;
    }
606424
public boolean next(K key, U value) throws IOException {
    if (hasNext()) {
      WritableUtils.cloneInto(key, khead);
      WritableUtils.cloneInto(value, vhead);
      next();
      return true;
    }
    return false;
  }
849038
@SuppressWarnings("unchecked")
    private void validateKey(int index) {
        final int size = (index + 1);
        if (null == this.keys) {
            // nothing has been created yet
            this.keys = (K[]) new Object[size];
        } else if (index >= this.keys.length) {
            // this row puts us beyond the current storage
            Object[] newKeys = new Object[size];
            System.arraycopy(this.keys, 0, newKeys, 0, this.keys.length);
            this.keys = (K[]) newKeys;
        }
    }
402453
public boolean containsKey(int key) {
        Entry tab[] = table;

        int index = (key & 0x7FFFFFFF) % tab.length;
        for (Entry e = tab[index]; e != null; e = e.next) {
            if (e.key == key) {
                return true;
            }
        }
        
        return false;
    }
57638
public static <K, V> Ordering<Entry<K, V>> byKeyOrdering(Ordering<K> keyOrdering) {
    return keyOrdering.onResultOf(MapUtils.<K, V>getEntryKey());
  }
777111
public final void incrementUnlockCount(long tick)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "incrementUnlockCount", Long.valueOf(tick));

    _targetStream.setCursor(tick);
    TickRange tickRange = _targetStream.getNext();
    if (tickRange.type == TickRange.Value)
    {
      AIValueTick valueTick = (AIValueTick) tickRange.value;
      if (valueTick != null)
        valueTick.incRMEUnlockCount();
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "incrementUnlockCount", tickRange);
  }
513819
static void blockyTandemMergeSort(final double[] keyArr, final long[] valArr, final int arrLen,
      final int blkSize) {
    assert blkSize >= 1;
    if (arrLen <= blkSize) { return; }
    int numblks = arrLen / blkSize;
    if ((numblks * blkSize) < arrLen) { numblks += 1; }
    assert ((numblks * blkSize) >= arrLen);

    // duplicate the input is preparation for the "ping-pong" copy reduction strategy.
    final double[] keyTmp = Arrays.copyOf(keyArr, arrLen);
    final long[] valTmp   = Arrays.copyOf(valArr, arrLen);

    blockyTandemMergeSortRecursion(keyTmp, valTmp,
                                   keyArr, valArr,
                                   0, numblks,
                                   blkSize, arrLen);
  }
1122769
private Entry<K, V> getEntry(K key) {
        final K k = key;
        
        return new Entry<K, V>() {
            public boolean equals(Object ob) {
                if( ob instanceof Entry ) {
                    Entry entry = (Entry)ob;
                    
                    if( !entry.getKey().equals(getKey()) ) {
                        return false;
                    }
                    if( !entry.getValue().equals(getValue()) ) {
                        return false;
                    }
                    return true;
                }
                return false;
            }

            public K getKey() {
                return k;
            }

            public V getValue() {
                return ConcurrentCache.this.get(getKey());
            }

            public V setValue(V val) {
                return ConcurrentCache.this.put(getKey(), val);
            }
        };
    }
745675
@Override
  public boolean removeIfEquals(K key, V _value) {
    Entry e = lookupEntry(key);
    if (e == null) {
      metrics.peekMiss();
      return false;
    }
    synchronized (e) {
      e.waitForProcessing();
      if (e.isGone()) {
        metrics.peekMiss();
        return false;
      }
      boolean f = e.hasFreshData(clock);
      if (f) {
        if (!e.equalsValue(_value)) {
          return false;
        }
      } else {
        metrics.peekHitNotFresh();
        return false;
      }
      removeEntry(e);
      return f;
    }
  }
1103425
static <K, V> K keyOrNull(final OMVRBTreeEntry<K, V> e) {
    return e == null ? null : e.getKey();
  }
743544
public ExceptionalStream<T, E> distinctBy(final Try.Function<? super T, ?, ? extends E> keyMapper) {
        checkArgNotNull(keyMapper, "keyMapper");

        final Set<Object> set = new HashSet<>();

        return filter(new Try.Predicate<T, E>() {
            @Override
            public boolean test(T value) throws E {
                return set.add(hashKey(keyMapper.apply(value)));
            }
        });
    }
1280792
@Override
    public Entry<K, V> higherEntry(K key)
    {
        Entry<K, V> entry = entry(key, null);
        return entrySet.higher(entry);
    }
861787
private void addKey(SelectionKey k) {
        assert Thread.holdsLock(keyLock);
        int i = 0;
        if ((keys != null) && (keyCount < keys.length)) {
            // Find empty element of key array
            for (i = 0; i < keys.length; i++)
                if (keys[i] == null)
                    break;
        } else if (keys == null) {
            keys =  new SelectionKey[3];
        } else {
            // Grow key array
            int n = keys.length * 2;
            SelectionKey[] ks =  new SelectionKey[n];
            for (i = 0; i < keys.length; i++)
                ks[i] = keys[i];
            keys = ks;
            i = keyCount;
        }
        keys[i] = k;
        keyCount++;
    }
994739
public void doesNotContainEntry(@NullableDecl Object key, @NullableDecl Object value) {
    checkNoNeedToDisplayBothValues("entrySet()")
        .that(actual().entrySet())
        .doesNotContain(immutableEntry(key, value));
  }
239559
public OMVRBTreeEntry<K, V> getHigherEntry(final K key) {
    final OMVRBTreeEntry<K, V> p = getEntry(key, true, PartialSearchMode.HIGHEST_BOUNDARY);

    if (p == null)
      return null;

    if (pageItemFound)
      // MATCH, RETURN THE NEXT ONE
      return next(p);
    else if (pageIndex < p.getSize())
      // NOT MATCHED, POSITION IS ALREADY TO THE NEXT ONE
      return p;

    return null;
  }