use of org.eclipse.collections.api.block.procedure.primitive.LongProcedure in project neo4j by neo4j.
the class MutableLinearProbeLongHashSetTest method forEach.
@Test
void forEach() {
final LongProcedure consumer = mock(LongProcedure.class);
set.addAll(1, 2, 100, 200);
set.forEach(consumer);
verify(consumer).accept(eq(1L));
verify(consumer).accept(eq(2L));
verify(consumer).accept(eq(100L));
verify(consumer).accept(eq(200L));
verifyNoMoreInteractions(consumer);
}
use of org.eclipse.collections.api.block.procedure.primitive.LongProcedure in project neo4j by neo4j.
the class LinearProbeLongLongHashMapTest method forEachValue.
@Test
void forEachValue() {
final LongProcedure consumer = mock(LongProcedure.class);
map.putAll(newWithKeysValues(0, 10, 1, 11, 2, 12));
map.forEachValue(consumer);
verify(consumer).value(eq(10L));
verify(consumer).value(eq(11L));
verify(consumer).value(eq(12L));
verifyNoMoreInteractions(consumer);
}
use of org.eclipse.collections.api.block.procedure.primitive.LongProcedure in project neo4j by neo4j.
the class LinearProbeLongLongHashMapTest method forEachKey.
@Test
void forEachKey() {
final LongProcedure consumer = mock(LongProcedure.class);
map.putAll(newWithKeysValues(0, 10, 1, 11, 2, 12));
map.forEachKey(consumer);
verify(consumer).value(eq(0L));
verify(consumer).value(eq(1L));
verify(consumer).value(eq(2L));
verifyNoMoreInteractions(consumer);
}
use of org.eclipse.collections.api.block.procedure.primitive.LongProcedure in project neo4j by neo4j.
the class TxStateIndexChanges method indexUpdatesWithValuesForSeek.
static AddedWithValuesAndRemoved indexUpdatesWithValuesForSeek(ReadableTransactionState txState, IndexDescriptor descriptor, ValueTuple values) {
UnmodifiableMap<ValueTuple, ? extends LongDiffSets> updates = txState.getIndexUpdates(descriptor.schema());
if (updates != null) {
LongDiffSets indexUpdatesForSeek = updates.get(values);
if (indexUpdatesForSeek == null) {
return EMPTY_ADDED_AND_REMOVED_WITH_VALUES;
}
Value[] valueArray = values.getValues();
MutableList<EntityWithPropertyValues> added = Lists.mutable.empty();
indexUpdatesForSeek.getAdded().forEach((LongProcedure) l -> added.add(new EntityWithPropertyValues(l, valueArray)));
return new AddedWithValuesAndRemoved(added, indexUpdatesForSeek.getRemoved());
}
return EMPTY_ADDED_AND_REMOVED_WITH_VALUES;
}
use of org.eclipse.collections.api.block.procedure.primitive.LongProcedure in project neo4j by neo4j.
the class ValuesMapTest method forEachKey.
@Test
void forEachKey() {
final LongProcedure consumer = mock(LongProcedure.class);
map.putAll(LongObjectHashMap.newWithKeysValues(0, intValue(10), 1, intValue(11), 2, intValue(12)));
map.forEachKey(consumer);
verify(consumer).value(eq(0L));
verify(consumer).value(eq(1L));
verify(consumer).value(eq(2L));
verifyNoMoreInteractions(consumer);
}
Aggregations