Search in sources :

Example 1 with ImmutableDoubleList

use of org.eclipse.collections.api.list.primitive.ImmutableDoubleList in project eclipse-collections by eclipse.

the class PrimitiveStreamsTest method toImmutableDoubleList.

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

Aggregations

ImmutableDoubleList (org.eclipse.collections.api.list.primitive.ImmutableDoubleList)1 Test (org.junit.Test)1