boolean (final int key, final IntPredicate valuesProcessor) { checkNotNoValue("key", key); final int capacity = capacity(); final int startIndex = Math.abs(key % capacity); for (int probe = 0; probe < capacity; probe++) { final int slotIndex = (startIndex + probe) % capacity; final int slotKey = table[slotIndex * 2]; final int slotValue = table[slotIndex * 2 + 1]; if (slotKey == key) { assert slotValue != NO_VALUE : "value(table[" + (slotIndex * 2 + 1) + "]) = " + NO_VALUE + " (NO_VALUE), " + "while key(table[" + slotIndex * 2 + "]) = " + key; if (!valuesProcessor.test(slotValue)) { return false; } } else if (slotKey == NO_VALUE && slotValue == NO_VALUE) { //free slot -> end of probing sequence, no (key, value) found: break; } } return true; }