boolean (@NotNull HashTableData table, int key, int value) { checkNotNoValue("key", key); checkNotNoValue("value", value); int capacity = capacity(table); int startIndex = Math.abs(hash(key) % capacity); for (int probe = 0; probe < capacity; probe++) { int slotIndex = (startIndex + probe) % capacity; int slotKey = table.entryKey(slotIndex); int slotValue = table.entryValue(slotIndex); if (slotKey == key && slotValue == value) { return true; } else if (slotKey == NO_VALUE && slotValue == NO_VALUE) { //free slot -> end of probing sequence, no (key, value) found: break; } } return false; }