Search in sources :

Example 1 with MutableLongStack

use of org.eclipse.collections.api.stack.primitive.MutableLongStack in project eclipse-collections by eclipse.

the class PrimitiveStreamsTest method toLongStack.

@Test
public void toLongStack() {
    MutableLongStack stack = PrimitiveStreams.mLongStack(LongStream.rangeClosed(1, 10));
    Assert.assertEquals(LongStacks.mutable.ofAll(IntInterval.oneTo(10).asLazy().collectLong(i -> (long) i)), stack);
    Assert.assertEquals(LongStacks.immutable.ofAll(LongStream.rangeClosed(1, 10)), stack);
}
Also used : MutableLongStack(org.eclipse.collections.api.stack.primitive.MutableLongStack) Test(org.junit.Test)

Aggregations

MutableLongStack (org.eclipse.collections.api.stack.primitive.MutableLongStack)1 Test (org.junit.Test)1