Search in sources :

Example 1 with ImmutableLongSet

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

the class PrimitiveStreamsTest method toImmutableLongSet.

@Test
public void toImmutableLongSet() {
    ImmutableLongSet set = PrimitiveStreams.iLongSet(LongStream.rangeClosed(1, 10));
    Assert.assertEquals(IntInterval.oneTo(10).collectLong(i -> (long) i, LongSets.mutable.empty()), set);
    Assert.assertEquals(LongSets.mutable.ofAll(LongStream.rangeClosed(1, 10)), set);
}
Also used : IntStream(java.util.stream.IntStream) ImmutableLongList(org.eclipse.collections.api.list.primitive.ImmutableLongList) LongLists(org.eclipse.collections.impl.factory.primitive.LongLists) ImmutableIntStack(org.eclipse.collections.api.stack.primitive.ImmutableIntStack) MutableIntBag(org.eclipse.collections.api.bag.primitive.MutableIntBag) ImmutableDoubleList(org.eclipse.collections.api.list.primitive.ImmutableDoubleList) DoubleLists(org.eclipse.collections.impl.factory.primitive.DoubleLists) MutableIntList(org.eclipse.collections.api.list.primitive.MutableIntList) MutableLongList(org.eclipse.collections.api.list.primitive.MutableLongList) MutableDoubleStack(org.eclipse.collections.api.stack.primitive.MutableDoubleStack) IntSets(org.eclipse.collections.impl.factory.primitive.IntSets) ImmutableDoubleBag(org.eclipse.collections.api.bag.primitive.ImmutableDoubleBag) DoubleSets(org.eclipse.collections.impl.factory.primitive.DoubleSets) MutableIntSet(org.eclipse.collections.api.set.primitive.MutableIntSet) ImmutableLongSet(org.eclipse.collections.api.set.primitive.ImmutableLongSet) IntStacks(org.eclipse.collections.impl.factory.primitive.IntStacks) ImmutableDoubleStack(org.eclipse.collections.api.stack.primitive.ImmutableDoubleStack) ImmutableIntBag(org.eclipse.collections.api.bag.primitive.ImmutableIntBag) LongStream(java.util.stream.LongStream) MutableLongBag(org.eclipse.collections.api.bag.primitive.MutableLongBag) MutableDoubleSet(org.eclipse.collections.api.set.primitive.MutableDoubleSet) LongStacks(org.eclipse.collections.impl.factory.primitive.LongStacks) DoubleStacks(org.eclipse.collections.impl.factory.primitive.DoubleStacks) ImmutableDoubleSet(org.eclipse.collections.api.set.primitive.ImmutableDoubleSet) MutableIntStack(org.eclipse.collections.api.stack.primitive.MutableIntStack) Test(org.junit.Test) ImmutableIntList(org.eclipse.collections.api.list.primitive.ImmutableIntList) LongBags(org.eclipse.collections.impl.factory.primitive.LongBags) DoubleStream(java.util.stream.DoubleStream) MutableLongSet(org.eclipse.collections.api.set.primitive.MutableLongSet) IntLists(org.eclipse.collections.impl.factory.primitive.IntLists) MutableDoubleList(org.eclipse.collections.api.list.primitive.MutableDoubleList) MutableLongStack(org.eclipse.collections.api.stack.primitive.MutableLongStack) IntInterval(org.eclipse.collections.impl.list.primitive.IntInterval) ImmutableLongBag(org.eclipse.collections.api.bag.primitive.ImmutableLongBag) LongSets(org.eclipse.collections.impl.factory.primitive.LongSets) ImmutableLongStack(org.eclipse.collections.api.stack.primitive.ImmutableLongStack) ImmutableIntSet(org.eclipse.collections.api.set.primitive.ImmutableIntSet) DoubleBags(org.eclipse.collections.impl.factory.primitive.DoubleBags) Assert(org.junit.Assert) IntBags(org.eclipse.collections.impl.factory.primitive.IntBags) MutableDoubleBag(org.eclipse.collections.api.bag.primitive.MutableDoubleBag) ImmutableLongSet(org.eclipse.collections.api.set.primitive.ImmutableLongSet) Test(org.junit.Test)

Aggregations

DoubleStream (java.util.stream.DoubleStream)1 IntStream (java.util.stream.IntStream)1 LongStream (java.util.stream.LongStream)1 ImmutableDoubleBag (org.eclipse.collections.api.bag.primitive.ImmutableDoubleBag)1 ImmutableIntBag (org.eclipse.collections.api.bag.primitive.ImmutableIntBag)1 ImmutableLongBag (org.eclipse.collections.api.bag.primitive.ImmutableLongBag)1 MutableDoubleBag (org.eclipse.collections.api.bag.primitive.MutableDoubleBag)1 MutableIntBag (org.eclipse.collections.api.bag.primitive.MutableIntBag)1 MutableLongBag (org.eclipse.collections.api.bag.primitive.MutableLongBag)1 ImmutableDoubleList (org.eclipse.collections.api.list.primitive.ImmutableDoubleList)1 ImmutableIntList (org.eclipse.collections.api.list.primitive.ImmutableIntList)1 ImmutableLongList (org.eclipse.collections.api.list.primitive.ImmutableLongList)1 MutableDoubleList (org.eclipse.collections.api.list.primitive.MutableDoubleList)1 MutableIntList (org.eclipse.collections.api.list.primitive.MutableIntList)1 MutableLongList (org.eclipse.collections.api.list.primitive.MutableLongList)1 ImmutableDoubleSet (org.eclipse.collections.api.set.primitive.ImmutableDoubleSet)1 ImmutableIntSet (org.eclipse.collections.api.set.primitive.ImmutableIntSet)1 ImmutableLongSet (org.eclipse.collections.api.set.primitive.ImmutableLongSet)1 MutableDoubleSet (org.eclipse.collections.api.set.primitive.MutableDoubleSet)1 MutableIntSet (org.eclipse.collections.api.set.primitive.MutableIntSet)1