package net.sf.kerner.utils.collections.map.collection.impl;

import java.util.LinkedHashSet;
import java.util.Set;

import net.sf.kerner.utils.Factory;
import net.sf.kerner.utils.collections.map.FactoryMap;
import net.sf.kerner.utils.collections.map.collection.MapCollectionAbstract;

public class MapSet<K, V> extends MapCollectionAbstract<K, V, Set<V>> {

    private final Factory<Set<V>> factory;

    public MapSet() {
        this.factory = new Factory<Set<V>>() {
            public Set<V> create() {
                return new LinkedHashSet<V>();
            }
        };
    }

    public MapSet(final FactoryMap<K, Set<V>> mapFactory, final Factory<Set<V>> factory) {
        super(mapFactory);
        this.factory = factory;
    }

    @Override
    protected Factory<Set<V>> getFactoryCollection() {
        return factory;
    }

}

@@ -59,40 +59,8 @@
 l;%0A%0A
-import java.util.LinkedHashSet;%0A
 impo
@@ -245,16 +245,86 @@
 bstract;
+%0Aimport net.sf.kerner.utils.collections.set.impl.FactoryLinkedHashSet;
 %0A%0Apublic
@@ -494,29 +494,35 @@
 tory
-%3C
+LinkedHash
 Set%3CV%3E
-%3E
 ()
- %7B
+;
 %0A    
-    
+%7D%0A%0A
     
@@ -532,53 +532,118 @@
 lic 
-Set%3CV%3E create() %7B%0A                return new 
+MapSet(final FactoryMap%3CK, Set%3CV%3E%3E mapFactory) %7B%0A        super(mapFactory);%0A        this.factory = new Factory
 Link
@@ -666,27 +666,159 @@
     
+%7D%0A%0A
     
-    %7D%0A        %7D
+public MapSet(final FactoryMap%3CK, Set%3CV%3E%3E mapFactory, final Factory%3CSet%3CV%3E%3E factory) %7B%0A        super(mapFactory);%0A        this.factory = factory
 ;%0A  
@@ -886,39 +886,60 @@
 , final 
-Factory%3CSet%3CV%3E%3E factory
+MapCollectionAbstract%3CK, V, Set%3CV%3E%3E template
 ) %7B%0A    
@@ -976,39 +976,246 @@
  this.factory = 
-factory
+new FactoryLinkedHashSet%3CV%3E();%0A        putAll(template);%0A    %7D%0A%0A    public MapSet(final MapCollectionAbstract%3CK, V, Set%3CV%3E%3E template) %7B%0A        this.factory = new FactoryLinkedHashSet%3CV%3E();%0A        putAll(template)
 ;%0A    %7D%0A%0A    @Ov

Add constructors.