Search in sources :

Example 1 with ImmutableDoubleSet

use of org.eclipse.collections.api.set.primitive.ImmutableDoubleSet in project eclipse-collections by eclipse.

the class PrimitiveStreamsTest method toImmutableDoubleSet.

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

Aggregations

ImmutableDoubleSet (org.eclipse.collections.api.set.primitive.ImmutableDoubleSet)1 Test (org.junit.Test)1