Search in sources :

Example 6 with IntegerWithCast

use of org.eclipse.collections.impl.IntegerWithCast in project eclipse-collections by eclipse.

the class MapIterableTestCase method nullCollisionWithCastInEquals.

@Test
public void nullCollisionWithCastInEquals() {
    if (this.newMap() instanceof SortedMap || this.newMap() instanceof ConcurrentMap) {
        return;
    }
    MapIterable<IntegerWithCast, String> mutableMap = this.newMapWithKeysValues(new IntegerWithCast(0), "Test 2", new IntegerWithCast(0), "Test 3", null, "Test 1");
    Assert.assertEquals(this.newMapWithKeysValues(new IntegerWithCast(0), "Test 3", null, "Test 1"), mutableMap);
    Assert.assertEquals("Test 3", mutableMap.get(new IntegerWithCast(0)));
    Assert.assertEquals("Test 1", mutableMap.get(null));
}
Also used : SortedMap(java.util.SortedMap) TreeSortedMap(org.eclipse.collections.impl.map.sorted.mutable.TreeSortedMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) IntegerWithCast(org.eclipse.collections.impl.IntegerWithCast) Test(org.junit.Test)

Example 7 with IntegerWithCast

use of org.eclipse.collections.impl.IntegerWithCast in project eclipse-collections by eclipse.

the class ImmutableHashBiMap2Test method nullCollisionWithCastInEquals.

@Override
@Test
public void nullCollisionWithCastInEquals() {
    ImmutableBiMap<IntegerWithCast, String> map = this.newMapWithKeysValues(new IntegerWithCast(0), "Test 2", null, "Test 1");
    Assert.assertEquals(this.newMapWithKeysValues(new IntegerWithCast(0), "Test 2", null, "Test 1"), map);
    Assert.assertEquals("Test 2", map.get(new IntegerWithCast(0)));
    Assert.assertEquals("Test 1", map.get(null));
}
Also used : IntegerWithCast(org.eclipse.collections.impl.IntegerWithCast) Test(org.junit.Test)

Example 8 with IntegerWithCast

use of org.eclipse.collections.impl.IntegerWithCast in project eclipse-collections by eclipse.

the class ImmutableHashBiMapInverse2Test method nullCollisionWithCastInEquals.

@Override
@Test
public void nullCollisionWithCastInEquals() {
    ImmutableBiMap<IntegerWithCast, String> map = this.newMapWithKeysValues(new IntegerWithCast(0), "Test 2", null, "Test 1");
    Assert.assertEquals(this.newMapWithKeysValues(new IntegerWithCast(0), "Test 2", null, "Test 1"), map);
    Assert.assertEquals("Test 2", map.get(new IntegerWithCast(0)));
    Assert.assertEquals("Test 1", map.get(null));
}
Also used : IntegerWithCast(org.eclipse.collections.impl.IntegerWithCast) Test(org.junit.Test)

Aggregations

IntegerWithCast (org.eclipse.collections.impl.IntegerWithCast)8 Test (org.junit.Test)8 SortedMap (java.util.SortedMap)2 ConcurrentMap (java.util.concurrent.ConcurrentMap)2 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 Iterator (java.util.Iterator)1 NoSuchElementException (java.util.NoSuchElementException)1 SortedSet (java.util.SortedSet)1 LazyIterable (org.eclipse.collections.api.LazyIterable)1 RichIterable (org.eclipse.collections.api.RichIterable)1 MutableSortedBag (org.eclipse.collections.api.bag.sorted.MutableSortedBag)1 Function (org.eclipse.collections.api.block.function.Function)1 MutableList (org.eclipse.collections.api.list.MutableList)1 MutableSet (org.eclipse.collections.api.set.MutableSet)1 UnsortedSetIterable (org.eclipse.collections.api.set.UnsortedSetIterable)1 Pair (org.eclipse.collections.api.tuple.Pair)1 Counter (org.eclipse.collections.impl.Counter)1 TreeBag (org.eclipse.collections.impl.bag.sorted.mutable.TreeBag)1 Predicates (org.eclipse.collections.impl.block.factory.Predicates)1