use of org.eclipse.collections.api.block.function.primitive.LongToObjectFunction in project mapdb by jankotek.
the class AbstractLongIterableTestCase method collect.
@Test
public void collect() {
LongToObjectFunction<Long> function = parameter -> parameter - 1;
Assert.assertEquals(this.newObjectCollectionWith(0L, 1L, 2L), this.newWith(1L, 2L, 3L).collect(function));
LongIterable iterable = this.newWith(1L, 2L, 2L, 3L, 3L, 3L);
Assert.assertEquals(this.newObjectCollectionWith(0L, 1L, 1L, 2L, 2L, 2L), iterable.collect(function));
Assert.assertEquals(this.newObjectCollectionWith(), this.newWith().collect(function));
Assert.assertEquals(this.newObjectCollectionWith(2L), this.newWith(3L).collect(function));
}
use of org.eclipse.collections.api.block.function.primitive.LongToObjectFunction in project mapdb by jankotek.
the class AbstractLongLongMapTestCase method collect.
@Test
public void collect() {
LongLongMap map = this.newWithKeysValues(0L, 0L, 1L, 1L, 2L, 2L, 3L, 3L);
LongToObjectFunction<Long> function = (parameter) -> parameter + 1;
Assert.assertEquals(Bags.immutable.with(1L, 2L, 3L, 4L), map.collect(function));
Assert.assertEquals(Bags.immutable.empty(), this.getEmptyMap().collect(function));
Assert.assertEquals(Bags.immutable.with(2L), this.newWithKeysValues(1L, 1L).collect(function));
}
Aggregations