Search in sources :

Example 1 with ImmutableDoubleStack

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

the class PrimitiveStreamsTest method toImmutableDoubleStack.

@Test
public void toImmutableDoubleStack() {
    ImmutableDoubleStack stack = PrimitiveStreams.iDoubleStack(DoubleStream.of(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0));
    Assert.assertEquals(DoubleStacks.mutable.ofAll(IntInterval.oneTo(10).asLazy().collectDouble(i -> (double) i)), stack);
    Assert.assertEquals(DoubleStacks.mutable.ofAll(DoubleStream.of(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)), stack);
}
Also used : ImmutableDoubleStack(org.eclipse.collections.api.stack.primitive.ImmutableDoubleStack) Test(org.junit.Test)

Aggregations

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