Search in sources :

Example 21 with NegativeIntervalFunction

use of org.eclipse.collections.impl.block.function.NegativeIntervalFunction in project eclipse-collections by eclipse.

the class AbstractImmutableSortedBagTestCase method groupByEach.

@Test
public void groupByEach() {
    ImmutableSortedBag<Integer> undertest = this.classUnderTest(Collections.reverseOrder());
    NegativeIntervalFunction function = new NegativeIntervalFunction();
    ImmutableSortedBagMultimap<Integer, Integer> actual = undertest.groupByEach(function);
    ImmutableSortedBagMultimap<Integer, Integer> expected = TreeBag.newBag(undertest).groupByEach(function).toImmutable();
    Assert.assertEquals(expected, actual);
    Assert.assertSame(Collections.reverseOrder(), actual.comparator());
}
Also used : NegativeIntervalFunction(org.eclipse.collections.impl.block.function.NegativeIntervalFunction) Test(org.junit.Test)

Aggregations

NegativeIntervalFunction (org.eclipse.collections.impl.block.function.NegativeIntervalFunction)21 Test (org.junit.Test)21 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 MutableList (org.eclipse.collections.api.list.MutableList)4 Multimap (org.eclipse.collections.api.multimap.Multimap)4 MutableMultimap (org.eclipse.collections.api.multimap.MutableMultimap)4 Procedures (org.eclipse.collections.impl.block.factory.Procedures)4 Lists (org.eclipse.collections.impl.factory.Lists)4 Interval (org.eclipse.collections.impl.list.Interval)4 FastList (org.eclipse.collections.impl.list.mutable.FastList)4 UnifiedSet (org.eclipse.collections.impl.set.mutable.UnifiedSet)4 Verify (org.eclipse.collections.impl.test.Verify)4 Assert (org.junit.Assert)4 Collections (java.util.Collections)3 List (java.util.List)3 RichIterable (org.eclipse.collections.api.RichIterable)3 Function (org.eclipse.collections.api.block.function.Function)3 MutableMap (org.eclipse.collections.api.map.MutableMap)3 Pair (org.eclipse.collections.api.tuple.Pair)3 IntegerPredicates (org.eclipse.collections.impl.block.factory.IntegerPredicates)3