/*
* Copyright 2015 Goldman Sachs.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gs.collections.impl.multimap.bag;
import com.gs.collections.api.bag.MutableBag;
import com.gs.collections.api.multimap.bag.MutableBagMultimap;
import com.gs.collections.api.tuple.Pair;
import com.gs.collections.impl.factory.Bags;
/**
* Test of {@link HashBagMultimap}.
*/
public class HashBagMultimapTest extends AbstractMutableBagMultimapTestCase
{
@Override
protected <K, V> MutableBagMultimap<K, V> newMultimap()
{
return HashBagMultimap.newMultimap();
}
@Override
protected <K, V> MutableBagMultimap<K, V> newMultimapWithKeyValue(K key, V value)
{
MutableBagMultimap<K, V> mutableMultimap = this.newMultimap();
mutableMultimap.put(key, value);
return mutableMultimap;
}
@Override
protected <K, V> MutableBagMultimap<K, V> newMultimapWithKeysValues(K key1, V value1, K key2, V value2)
{
MutableBagMultimap<K, V> mutableMultimap = this.newMultimap();
mutableMultimap.put(key1, value1);
mutableMultimap.put(key2, value2);
return mutableMultimap;
}
@Override
protected <K, V> MutableBagMultimap<K, V> newMultimapWithKeysValues(
K key1, V value1,
K key2, V value2,
K key3, V value3)
{
MutableBagMultimap<K, V> mutableMultimap = this.newMultimap();
mutableMultimap.put(key1, value1);
mutableMultimap.put(key2, value2);
mutableMultimap.put(key3, value3);
return mutableMultimap;
}
@Override
protected <K, V> MutableBagMultimap<K, V> newMultimapWithKeysValues(
K key1, V value1,
K key2, V value2,
K key3, V value3,
K key4, V value4)
{
MutableBagMultimap<K, V> mutableMultimap = this.newMultimap();
mutableMultimap.put(key1, value1);
mutableMultimap.put(key2, value2);
mutableMultimap.put(key3, value3);
mutableMultimap.put(key4, value4);
return mutableMultimap;
}
@SafeVarargs
@Override
protected final <K, V> MutableBagMultimap<K, V> newMultimap(Pair<K, V>... pairs)
{
return HashBagMultimap.newMultimap(pairs);
}
@Override
protected <K, V> MutableBagMultimap<K, V> newMultimapFromPairs(Iterable<Pair<K, V>> inputIterable)
{
return HashBagMultimap.newMultimap(inputIterable);
}
@SafeVarargs
@Override
protected final <V> MutableBag<V> createCollection(V... args)
{
return Bags.mutable.of(args);
}
}