import "copyrightAndOthers.stg"
import "primitiveEquals.stg"
import "primitiveHashCode.stg"
import "primitiveLiteral.stg"

isTest() ::= "true"

hasTwoPrimitives() ::= "true"

skipBoolean() ::= "true"

targetPath() ::= "org/eclipse/collections/impl/factory/primitive"

fileName(primitive1, primitive2, sameTwoPrimitives) ::= "<primitive1.name><primitive2.name>MapsTest"

class(primitive1, primitive2, sameTwoPrimitives) ::= <<
<body(primitive1.type, primitive2.type, primitive1.name, primitive2.name)>
>>

body(type1, type2, name1, name2) ::= <<
<copyrightAndOthers()>

package org.eclipse.collections.impl.factory.primitive;

import org.eclipse.collections.api.factory.map.primitive.Immutable<name1><name2>MapFactory;
import org.eclipse.collections.api.factory.map.primitive.Mutable<name1><name2>MapFactory;
import org.eclipse.collections.impl.map.mutable.primitive.<name1><name2>HashMap;
import org.junit.Assert;
import org.junit.Test;

/**
 * Junit test for {@link <name1><name2>Maps}
 * This file was automatically generated from template file primitivePrimitiveMapsTest.stg
 */
public class <name1><name2>MapsTest
{
    @Test
    public void immutables()
    {
        this.assertImmutableMapFactory(<name1><name2>Maps.immutable);
        this.assertImmutableMapFactory(org.eclipse.collections.api.factory.primitive.<name1><name2>Maps.immutable);
    }

    private void assertImmutableMapFactory(Immutable<name1><name2>MapFactory mapFactory)
    {
        Assert.assertSame(new <name1><name2>HashMap().toImmutable(), mapFactory.with());
        Assert.assertSame(new <name1><name2>HashMap().toImmutable(), mapFactory.of());
        Assert.assertEquals(<name1><name2>HashMap.newWithKeysValues(<(literal.(type1))("1")>, <(literal.(type2))("1")>).toImmutable(), mapFactory.of(<(literal.(type1))("1")>, <(literal.(type2))("1")>));
        <name1><name2>HashMap sourceMap = <name1><name2>HashMap.newWithKeysValues(<(literal.(type1))("1")>, <(literal.(type2))("1")>);
        Assert.assertEquals(sourceMap.toImmutable(), mapFactory.ofAll(sourceMap));
        Assert.assertEquals(sourceMap.toImmutable(), mapFactory.withAll(sourceMap));
    }

    @Test
    public void mutables()
    {
        this.assertMutableMapFactory(<name1><name2>Maps.mutable);
        this.assertMutableMapFactory(org.eclipse.collections.api.factory.primitive.<name1><name2>Maps.mutable);
    }

    private void assertMutableMapFactory(Mutable<name1><name2>MapFactory mapFactory)
    {
        Assert.assertEquals(new <name1><name2>HashMap(), mapFactory.with());
        Assert.assertEquals(new <name1><name2>HashMap(), mapFactory.of());
        <name1><name2>HashMap sourceMap = <name1><name2>HashMap.newWithKeysValues(<(literal.(type1))("1")>, <(literal.(type2))("1")>);
        Assert.assertEquals(sourceMap, mapFactory.ofAll(sourceMap));
        Assert.assertEquals(sourceMap, mapFactory.withAll(sourceMap));
    }
}

>>
