public override void ForEachKeyValue(LongLongProcedure procedure) { if (_hasZeroKey) { procedure.value(0, _zeroValue); } if (_hasOneKey) { procedure.value(1, _oneValue); } int left = _entriesInMemory; for (int i = 0; i < _capacity && left > 0; i++) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long key = getKeyAt(i); long key = GetKeyAt(i); if (!IsSentinelKey(key)) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long value = getValueAt(i); long value = GetValueAt(i); procedure.value(key, value); --left; } } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void forEachKeyValue() internal virtual void ForEachKeyValue() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.eclipse.collections.api.block.procedure.primitive.LongLongProcedure consumer = mock(org.eclipse.collections.api.block.procedure.primitive.LongLongProcedure.class); LongLongProcedure consumer = mock(typeof(LongLongProcedure)); _map.putAll(newWithKeysValues(0, 10, 1, 11, 2, 12)); _map.forEachKeyValue(consumer); verify(consumer).value(eq(0L), eq(10L)); verify(consumer).value(eq(1L), eq(11L)); verify(consumer).value(eq(2L), eq(12L)); verifyNoMoreInteractions(consumer); }