// Path: src/main/java/org/intellimate/izou/identification/Identifiable.java
// @AddonAccessible
// public interface Identifiable {
//     /**
//      * An ID must always be unique.
//      * A Class like Activator or OutputPlugin can just provide their .class.getCanonicalName()
//      * If you have to implement this interface multiple times, just concatenate unique Strings to
//      * .class.getCanonicalName()
//      * @return A String containing an ID
//      */
//     String getID();
// 
//     /**
//      * checks whether this instance is the owner of this Identification
//      * @param identification the identification to check
//      * @return true if the same, false if not
//      */
//     default boolean isOwner(Identification identification) {
//         return getID().equals(identification.getID());
//     }
// }
// 
// Path: src/main/java/org/intellimate/izou/identification/Identification.java
// @AddonAccessible
// public interface Identification {
//     /**
//      * returns the ID of the owner of the Identification
//      * @return a String containing the ID
//      */
//     String getID();
// 
//     /**
//      * this method returns whether this Identification Object was created by the owner
//      * @return true if created by the owner, false if not
//      */
//     boolean isCreatedFromInstance();
// }
// 
// Path: src/main/java/org/intellimate/izou/identification/IdentificationManager.java
// @Deprecated
// @AddonAccessible
// public interface IdentificationManager extends IdentificationManagerM {
//     /**
//      * returns the IndentificationManager-Instance
//      * @return the instance
//      */
//     @Deprecated
//     static IdentificationManagerM getInstance() {
//         return IdentificationManagerImpl.singletonInstance;
//     }
// }


import org.intellimate.izou.identification.Identifiable;
import org.intellimate.izou.identification.Identification;
import org.intellimate.izou.identification.IdentificationManager;
import java.util.*;
package org.intellimate.izou.util;



/**
 * It has the same Properties as an normal HashSet, but (optionally) keeps an Identification for every object to
 * identify its source.
 *
 * @author Leander Kurscheidt
 * @version 1.0
 */
public class IdentificationSet<X> extends AbstractSet<X> implements Set<X>, Cloneable, Identifiable {
    private HashMap<X, Identification> map;
    private boolean allowElementsWithoutIdentification = false;
    private static Identification placeholder = null;

    /**
     * Constructs a new, empty set;
     * <p>
     * the backing HashMap instance has default initial capacity (16) and load factor (0.75).
     * </p>
     */
    public IdentificationSet() {
        map = new HashMap<>();
        init();
    }

    /**
     * Constructs a new, empty set.
     * <p>the backing HashMap instance has the specified initial capacity and the specified load factor.</p>
     * @param initialCapacity the initial capacity of the hash map
     * @param loadFactor the load factor of the hash map
     * @throws java.lang.IllegalArgumentException if the initial capacity is less than zero, or if the load factor is
     *                                          nonpositive
     */
    public IdentificationSet(int initialCapacity, float loadFactor) {
        map = new HashMap<>(initialCapacity, loadFactor);
        init();
    }

    /**
     * Constructs a new, empty set.
     * <p>the backing HashMap instance has the specified initial capacity and default load factor (0.75).</p>
     * @param initialCapacity initialCapacity the initial capacity of the hash table
     * @throws java.lang.IllegalArgumentException if the initial capacity is less than zero
     */
    public IdentificationSet(int initialCapacity) {
        map = new HashMap<>(initialCapacity);
        init();
    }

    /**
     * Constructs a new, empty set;
     * <p>
     * the backing HashMap instance has default initial capacity (16) and load factor (0.75).
     * </p>
     * @param allow whether it is allowed to put Elements without Identification in this Set
     */
    public IdentificationSet(boolean allow) {
        map = new HashMap<>();
        allowElementsWithoutIdentification = allow;
        init();
    }

    /**
     * Constructs a new, empty set.
     * <p>the backing HashMap instance has the specified initial capacity and the specified load factor.</p>
     * @param initialCapacity the initial capacity of the hash map
     * @param loadFactor the load factor of the hash map
     * @param allow whether it is allowed to put Elements without Identification in this Set
     * @throws java.lang.IllegalArgumentException if the initial capacity is less than zero, or if the load factor is
     *                                          nonpositive
     */
    public IdentificationSet(int initialCapacity, float loadFactor, boolean allow) {
        map = new HashMap<>(initialCapacity, loadFactor);
// Path: src/main/java/org/intellimate/izou/identification/Identifiable.java
// @AddonAccessible
// public interface Identifiable {
//     /**
//      * An ID must always be unique.
//      * A Class like Activator or OutputPlugin can just provide their .class.getCanonicalName()
//      * If you have to implement this interface multiple times, just concatenate unique Strings to
//      * .class.getCanonicalName()
//      * @return A String containing an ID
//      */
//     String getID();
// 
//     /**
//      * checks whether this instance is the owner of this Identification
//      * @param identification the identification to check
//      * @return true if the same, false if not
//      */
//     default boolean isOwner(Identification identification) {
//         return getID().equals(identification.getID());
//     }
// }
// 
// Path: src/main/java/org/intellimate/izou/identification/Identification.java
// @AddonAccessible
// public interface Identification {
//     /**
//      * returns the ID of the owner of the Identification
//      * @return a String containing the ID
//      */
//     String getID();
// 
//     /**
//      * this method returns whether this Identification Object was created by the owner
//      * @return true if created by the owner, false if not
//      */
//     boolean isCreatedFromInstance();
// }
// 
// Path: src/main/java/org/intellimate/izou/identification/IdentificationManager.java
// @Deprecated
// @AddonAccessible
// public interface IdentificationManager extends IdentificationManagerM {
//     /**
//      * returns the IndentificationManager-Instance
//      * @return the instance
//      */
//     @Deprecated
//     static IdentificationManagerM getInstance() {
//         return IdentificationManagerImpl.singletonInstance;
//     }
// }


// Path: src/main/java/org/intellimate/izou/util/IdentificationSet.java
import org.intellimate.izou.identification.Identifiable;
import org.intellimate.izou.identification.Identification;
import org.intellimate.izou.identification.IdentificationManager;
import java.util.*;

package org.intellimate.izou.util;



/**
 * It has the same Properties as an normal HashSet, but (optionally) keeps an Identification for every object to
 * identify its source.
 *
 * @author Leander Kurscheidt
 * @version 1.0
 */
public class IdentificationSet<X> extends AbstractSet<X> implements Set<X>, Cloneable, Identifiable {
    private HashMap<X, Identification> map;
    private boolean allowElementsWithoutIdentification = false;
    private static Identification placeholder = null;

    /**
     * Constructs a new, empty set;
     * <p>
     * the backing HashMap instance has default initial capacity (16) and load factor (0.75).
     * </p>
     */
    public IdentificationSet() {
        map = new HashMap<>();
        init();
    }

    /**
     * Constructs a new, empty set.
     * <p>the backing HashMap instance has the specified initial capacity and the specified load factor.</p>
     * @param initialCapacity the initial capacity of the hash map
     * @param loadFactor the load factor of the hash map
     * @throws java.lang.IllegalArgumentException if the initial capacity is less than zero, or if the load factor is
     *                                          nonpositive
     */
    public IdentificationSet(int initialCapacity, float loadFactor) {
        map = new HashMap<>(initialCapacity, loadFactor);
        init();
    }

    /**
     * Constructs a new, empty set.
     * <p>the backing HashMap instance has the specified initial capacity and default load factor (0.75).</p>
     * @param initialCapacity initialCapacity the initial capacity of the hash table
     * @throws java.lang.IllegalArgumentException if the initial capacity is less than zero
     */
    public IdentificationSet(int initialCapacity) {
        map = new HashMap<>(initialCapacity);
        init();
    }

    /**
     * Constructs a new, empty set;
     * <p>
     * the backing HashMap instance has default initial capacity (16) and load factor (0.75).
     * </p>
     * @param allow whether it is allowed to put Elements without Identification in this Set
     */
    public IdentificationSet(boolean allow) {
        map = new HashMap<>();
        allowElementsWithoutIdentification = allow;
        init();
    }

    /**
     * Constructs a new, empty set.
     * <p>the backing HashMap instance has the specified initial capacity and the specified load factor.</p>
     * @param initialCapacity the initial capacity of the hash map
     * @param loadFactor the load factor of the hash map
     * @param allow whether it is allowed to put Elements without Identification in this Set
     * @throws java.lang.IllegalArgumentException if the initial capacity is less than zero, or if the load factor is
     *                                          nonpositive
     */
    public IdentificationSet(int initialCapacity, float loadFactor, boolean allow) {
        map = new HashMap<>(initialCapacity, loadFactor);
        allowElementsWithoutIdentification = allow;