Search in sources :

Example 1 with MutableDoubleStack

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

the class PrimitiveStreamsTest method toDoubleStack.

@Test
public void toDoubleStack() {
    MutableDoubleStack stack = PrimitiveStreams.mDoubleStack(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.immutable.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 : MutableDoubleStack(org.eclipse.collections.api.stack.primitive.MutableDoubleStack) Test(org.junit.Test)

Aggregations

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