/*
 * @author Ranides Atterwim {@literal <ranides@gmail.com>}
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.collection.maps;

import java.util.Collection;
import java.util.Set;
import net.ranides.test.ContractTesters;
import net.ranides.test.data.TMaps;
import net.ranides.test.data.TPoint;
import net.ranides.test.data.TMap;
import org.junit.Test;

/**
 *
 * @author Ranides Atterwim {@literal <ranides@gmail.com>}
 */
public class MultiMapTest {
    
    private final TMap<TPoint, Integer> $map = TMaps.MAP_PI;
    
    @Test
    public void testSuite() {
        ContractTesters.runner()
            .param("map!", $map)
            .ignore("MapTester.basicEquals_HC")
            .function(new int[0], array -> $map.list(array).into(new MTMap()))
			.run();
    }
    
    private static final class MTMap extends AMap<TPoint, Integer> implements MultiMap<TPoint, Integer> {
        
        private final OpenMultiMap<TPoint, Integer> data = new OpenMultiMap<>();

        @Override
        public Set<Entry<TPoint, Integer>> entrySet() {
            return data.entrySet();
        }

        @Override
        public int size() {
            return data.size();
        }

        @Override
        public boolean containsKey(Object key) {
            return data.containsKey(key);
        }

        @Override
        public boolean containsValue(Object value) {
            return data.containsValue(value);
        }

        @Override
        public Integer get(Object key) {
            return data.get(key);
        }

        @Override
        public Collection<Integer> getAll(Object key) {
            return data.getAll(key);
        }

        @Override
        public Integer put(TPoint key, Integer value) {
            return data.put(key, value);
        }

        @Override
        public Integer remove(Object key) {
            return data.remove(key);
        }

    }
}
