Search in sources :

Example 1 with ImmutableLongStack

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

the class PrimitiveStreamsTest method toImmutableLongStack.

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

Aggregations

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