Search in sources :

Example 1 with ImmutableSortedBag

use of org.eclipse.collections.api.bag.sorted.ImmutableSortedBag in project eclipse-collections by eclipse.

the class ImmutableEmptySortedBagTest method collectBoolean.

@Override
@Test
public void collectBoolean() {
    ImmutableSortedBag<Integer> bag = this.classUnderTest();
    Assert.assertEquals(new BooleanArrayList(), bag.collectBoolean(each -> false));
}
Also used : Maps(org.eclipse.collections.impl.factory.Maps) CharHashBag(org.eclipse.collections.impl.bag.mutable.primitive.CharHashBag) SortedBags(org.eclipse.collections.impl.factory.SortedBags) ObjectIntPair(org.eclipse.collections.api.tuple.primitive.ObjectIntPair) Verify(org.eclipse.collections.impl.test.Verify) MutableList(org.eclipse.collections.api.list.MutableList) MutableSortedMap(org.eclipse.collections.api.map.sorted.MutableSortedMap) ImmutableSortedSet(org.eclipse.collections.api.set.sorted.ImmutableSortedSet) DoubleArrayList(org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList) HashBag(org.eclipse.collections.impl.bag.mutable.HashBag) Functions(org.eclipse.collections.impl.block.factory.Functions) ShortArrayList(org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList) ShortHashBag(org.eclipse.collections.impl.bag.mutable.primitive.ShortHashBag) Comparators(org.eclipse.collections.impl.block.factory.Comparators) SortedMaps(org.eclipse.collections.impl.factory.SortedMaps) DoubleHashBag(org.eclipse.collections.impl.bag.mutable.primitive.DoubleHashBag) IntArrayList(org.eclipse.collections.impl.list.mutable.primitive.IntArrayList) UnifiedMap(org.eclipse.collections.impl.map.mutable.UnifiedMap) ByteArrayList(org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList) ByteHashBag(org.eclipse.collections.impl.bag.mutable.primitive.ByteHashBag) CharArrayList(org.eclipse.collections.impl.list.mutable.primitive.CharArrayList) BooleanHashBag(org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag) FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList) MutableSortedSet(org.eclipse.collections.api.set.sorted.MutableSortedSet) Lists(org.eclipse.collections.impl.factory.Lists) PartitionSortedBag(org.eclipse.collections.api.partition.bag.sorted.PartitionSortedBag) LongArrayList(org.eclipse.collections.impl.list.mutable.primitive.LongArrayList) ImmutableSortedBag(org.eclipse.collections.api.bag.sorted.ImmutableSortedBag) Stacks(org.eclipse.collections.impl.factory.Stacks) LongHashBag(org.eclipse.collections.impl.bag.mutable.primitive.LongHashBag) FastList(org.eclipse.collections.impl.list.mutable.FastList) Iterables(org.eclipse.collections.impl.factory.Iterables) BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) TreeBag(org.eclipse.collections.impl.bag.sorted.mutable.TreeBag) PrimitiveTuples(org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples) NoSuchElementException(java.util.NoSuchElementException) Pair(org.eclipse.collections.api.tuple.Pair) MutableCollection(org.eclipse.collections.api.collection.MutableCollection) PrimitiveFunctions(org.eclipse.collections.impl.block.factory.PrimitiveFunctions) Predicates(org.eclipse.collections.impl.block.factory.Predicates) Predicates2(org.eclipse.collections.impl.block.factory.Predicates2) SortedSets(org.eclipse.collections.impl.factory.SortedSets) TreeSortedMap(org.eclipse.collections.impl.map.sorted.mutable.TreeSortedMap) Test(org.junit.Test) PartitionImmutableSortedBag(org.eclipse.collections.api.partition.bag.sorted.PartitionImmutableSortedBag) ImmutableList(org.eclipse.collections.api.list.ImmutableList) Comparator(java.util.Comparator) FloatHashBag(org.eclipse.collections.impl.bag.mutable.primitive.FloatHashBag) Assert(org.junit.Assert) Collections(java.util.Collections) IntHashBag(org.eclipse.collections.impl.bag.mutable.primitive.IntHashBag) BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) Test(org.junit.Test)

Example 2 with ImmutableSortedBag

use of org.eclipse.collections.api.bag.sorted.ImmutableSortedBag in project eclipse-collections by eclipse.

the class ImmutableEmptySortedBagTest method collectBoolean_target.

@Override
@Test
public void collectBoolean_target() {
    ImmutableSortedBag<Integer> bag = this.classUnderTest();
    Assert.assertEquals(new BooleanArrayList(), bag.collectBoolean(each -> false, new BooleanArrayList()));
    ImmutableSortedBag<Integer> bag2 = this.classUnderTest();
    Assert.assertEquals(new BooleanHashBag(), bag2.collectBoolean(each -> false, new BooleanHashBag()));
}
Also used : Maps(org.eclipse.collections.impl.factory.Maps) CharHashBag(org.eclipse.collections.impl.bag.mutable.primitive.CharHashBag) SortedBags(org.eclipse.collections.impl.factory.SortedBags) ObjectIntPair(org.eclipse.collections.api.tuple.primitive.ObjectIntPair) Verify(org.eclipse.collections.impl.test.Verify) MutableList(org.eclipse.collections.api.list.MutableList) MutableSortedMap(org.eclipse.collections.api.map.sorted.MutableSortedMap) ImmutableSortedSet(org.eclipse.collections.api.set.sorted.ImmutableSortedSet) DoubleArrayList(org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList) HashBag(org.eclipse.collections.impl.bag.mutable.HashBag) Functions(org.eclipse.collections.impl.block.factory.Functions) ShortArrayList(org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList) ShortHashBag(org.eclipse.collections.impl.bag.mutable.primitive.ShortHashBag) Comparators(org.eclipse.collections.impl.block.factory.Comparators) SortedMaps(org.eclipse.collections.impl.factory.SortedMaps) DoubleHashBag(org.eclipse.collections.impl.bag.mutable.primitive.DoubleHashBag) IntArrayList(org.eclipse.collections.impl.list.mutable.primitive.IntArrayList) UnifiedMap(org.eclipse.collections.impl.map.mutable.UnifiedMap) ByteArrayList(org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList) ByteHashBag(org.eclipse.collections.impl.bag.mutable.primitive.ByteHashBag) CharArrayList(org.eclipse.collections.impl.list.mutable.primitive.CharArrayList) BooleanHashBag(org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag) FloatArrayList(org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList) MutableSortedSet(org.eclipse.collections.api.set.sorted.MutableSortedSet) Lists(org.eclipse.collections.impl.factory.Lists) PartitionSortedBag(org.eclipse.collections.api.partition.bag.sorted.PartitionSortedBag) LongArrayList(org.eclipse.collections.impl.list.mutable.primitive.LongArrayList) ImmutableSortedBag(org.eclipse.collections.api.bag.sorted.ImmutableSortedBag) Stacks(org.eclipse.collections.impl.factory.Stacks) LongHashBag(org.eclipse.collections.impl.bag.mutable.primitive.LongHashBag) FastList(org.eclipse.collections.impl.list.mutable.FastList) Iterables(org.eclipse.collections.impl.factory.Iterables) BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) TreeBag(org.eclipse.collections.impl.bag.sorted.mutable.TreeBag) PrimitiveTuples(org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples) NoSuchElementException(java.util.NoSuchElementException) Pair(org.eclipse.collections.api.tuple.Pair) MutableCollection(org.eclipse.collections.api.collection.MutableCollection) PrimitiveFunctions(org.eclipse.collections.impl.block.factory.PrimitiveFunctions) Predicates(org.eclipse.collections.impl.block.factory.Predicates) Predicates2(org.eclipse.collections.impl.block.factory.Predicates2) SortedSets(org.eclipse.collections.impl.factory.SortedSets) TreeSortedMap(org.eclipse.collections.impl.map.sorted.mutable.TreeSortedMap) Test(org.junit.Test) PartitionImmutableSortedBag(org.eclipse.collections.api.partition.bag.sorted.PartitionImmutableSortedBag) ImmutableList(org.eclipse.collections.api.list.ImmutableList) Comparator(java.util.Comparator) FloatHashBag(org.eclipse.collections.impl.bag.mutable.primitive.FloatHashBag) Assert(org.junit.Assert) Collections(java.util.Collections) IntHashBag(org.eclipse.collections.impl.bag.mutable.primitive.IntHashBag) BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) BooleanHashBag(org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag) Test(org.junit.Test)

Aggregations

Collections (java.util.Collections)2 Comparator (java.util.Comparator)2 NoSuchElementException (java.util.NoSuchElementException)2 ImmutableSortedBag (org.eclipse.collections.api.bag.sorted.ImmutableSortedBag)2 MutableCollection (org.eclipse.collections.api.collection.MutableCollection)2 ImmutableList (org.eclipse.collections.api.list.ImmutableList)2 MutableList (org.eclipse.collections.api.list.MutableList)2 MutableSortedMap (org.eclipse.collections.api.map.sorted.MutableSortedMap)2 PartitionImmutableSortedBag (org.eclipse.collections.api.partition.bag.sorted.PartitionImmutableSortedBag)2 PartitionSortedBag (org.eclipse.collections.api.partition.bag.sorted.PartitionSortedBag)2 ImmutableSortedSet (org.eclipse.collections.api.set.sorted.ImmutableSortedSet)2 MutableSortedSet (org.eclipse.collections.api.set.sorted.MutableSortedSet)2 Pair (org.eclipse.collections.api.tuple.Pair)2 ObjectIntPair (org.eclipse.collections.api.tuple.primitive.ObjectIntPair)2 HashBag (org.eclipse.collections.impl.bag.mutable.HashBag)2 BooleanHashBag (org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag)2 ByteHashBag (org.eclipse.collections.impl.bag.mutable.primitive.ByteHashBag)2 CharHashBag (org.eclipse.collections.impl.bag.mutable.primitive.CharHashBag)2 DoubleHashBag (org.eclipse.collections.impl.bag.mutable.primitive.DoubleHashBag)2 FloatHashBag (org.eclipse.collections.impl.bag.mutable.primitive.FloatHashBag)2