diff --git a/src/builder/java/speiger/src/builder/RequiredType.java b/src/builder/java/speiger/src/builder/RequiredType.java index 0a11cbd..d02a1c2 100644 --- a/src/builder/java/speiger/src/builder/RequiredType.java +++ b/src/builder/java/speiger/src/builder/RequiredType.java @@ -1,8 +1,8 @@ -package speiger.src.builder; - -@SuppressWarnings("javadoc") -public enum RequiredType -{ - BI_CLASS, - ENUM -} +package speiger.src.builder; + +@SuppressWarnings("javadoc") +public enum RequiredType +{ + BI_CLASS, + ENUM +} diff --git a/src/builder/java/speiger/src/builder/modules/FunctionModule.java b/src/builder/java/speiger/src/builder/modules/FunctionModule.java index 5a84b95..5e401cf 100644 --- a/src/builder/java/speiger/src/builder/modules/FunctionModule.java +++ b/src/builder/java/speiger/src/builder/modules/FunctionModule.java @@ -1,123 +1,124 @@ -package speiger.src.builder.modules; - -import java.util.Arrays; -import java.util.List; - -import speiger.src.builder.ClassType; -import speiger.src.builder.RequiredType; -import speiger.src.builder.dependencies.IDependency; -import speiger.src.builder.dependencies.ModuleDependency; - -@SuppressWarnings("javadoc") -public class FunctionModule extends BaseModule -{ - public static final BaseModule INSTANCE = new FunctionModule(); - public static final ModuleDependency MODULE = new ModuleDependency(INSTANCE, false).addKeyDependency(JavaModule.MODULE); - - @Override - public String getModuleName() { return "Function"; } - @Override - public boolean isBiModule() { return true; } - @Override - protected void loadVariables() {} - @Override - protected void loadFlags() {} - @Override - protected void loadTestClasses() {} - - @Override - public List getDependencies(ClassType keyType, ClassType valueType) { - return Arrays.asList(MODULE); - } - - @Override - protected void loadBlockades() - { - if(keyType.isObject()) addBlockedFiles("Consumer", "Comparator"); - if(!MODULE.isEnabled()) addBlockedFiles("Consumer", "BiConsumer", "Comparator", "Supplier", "Optional", "Function", "UnaryOperator"); - if(!keyType.needsCustomJDKType()) addBlockedFiles("Optional"); - } - - @Override - protected void loadRemappers() - { - addBiRequirement("BiConsumer", ""); - addBiRequirement("UnaryOperator", ""); - if(valueType == ClassType.BOOLEAN) { - addRequirement("Function", "%1$s", RequiredType.BI_CLASS); - addRemapper("Function", (keyType.isObject() ? "" : "%s")+"Predicate"); - } - else if(keyType.isObject() && !valueType.isObject()) { - addRequirement("Function", "%2$s", RequiredType.BI_CLASS); - addRemapper("Function", "To%sFunction"); - } - else if(keyType == valueType) { - addRequirement("Function", "%1$s", RequiredType.BI_CLASS); - addRemapper("Function", (keyType.isObject() ? "" : "%s")+"UnaryOperator"); - } - else if(valueType.isObject()) { - addRequirement("Function", "%1$s", RequiredType.BI_CLASS); - addRemapper("Function", "%sFunction"); - } - else addBiRequirement("Function"); - addRemapper("BiConsumer", "%sConsumer"); - addRemapper("Optional", "Optional%s"); - } - - @Override - protected void loadFunctions() - { - addSimpleMapper("APPLY", keyType.getApply(valueType)); - addSimpleMapper("SUPPLY_GET", keyType.isObject() ? "get" : "getAs"+keyType.getNonFileType()); - addSimpleMapper("VALUE_SUPPLY_GET", valueType.isObject() ? "get" : "getAs"+valueType.getNonFileType()); - } - - @Override - protected void loadClasses() - { - //Interfaces - addBiClassMapper("BI_CONSUMER", "Consumer", ""); - addClassMapper("BI_TO_OBJECT_CONSUMER", "ObjectConsumer"); - addAbstractMapper("BI_FROM_OBJECT_CONSUMER", "Object%sConsumer"); - addAbstractMapper("BI_FROM_INT_CONSUMER", "Int%sConsumer"); - if(keyType.isObject()) { - addSimpleMapper("TO_OBJECT_FUNCTION", keyType.getNonFileType()+"UnaryOperator"); - addSimpleMapper("VALUE_TO_OBJECT_FUNCTION", valueType.isObject() ? "UnaryOperator" : valueType.getFileType()+"Function"); - } - else { - addSimpleMapper("TO_OBJECT_FUNCTION", keyType.getNonFileType()+"Function"); - addSimpleMapper("VALUE_TO_OBJECT_FUNCTION", valueType.isObject() ? "UnaryOperator" : valueType.getFileType()+"Function"); - } - if(valueType == ClassType.BOOLEAN) addFunctionMappers("FUNCTION", "%sPredicate"); - else if(keyType.isObject() && !valueType.isObject()) addFunctionValueMappers("FUNCTION", "To%sFunction"); - else if(keyType == valueType) addFunctionMappers("FUNCTION", "%sUnaryOperator"); - else if(valueType.isObject()) addFunctionMappers("FUNCTION", "%sFunction"); - else addBiClassMapper("FUNCTION", "Function", "2"); - - addFunctionMappers("PREDICATE", "%sPredicate"); - addClassMapper("SUPPLIER", "Supplier"); - addSimpleMapper("OPTIONAL", keyType.isObject() ? "Optional" : String.format("Optional%s", keyType.getFileType())); - addSimpleMapper("VALUE_OPTIONAL", valueType.isObject() ? "Optional" : String.format("Optional%s", valueType.getFileType())); - addAbstractMapper("SINGLE_UNARY_OPERATOR", "%1$s%1$sUnaryOperator"); - addBiClassMapper("UNARY_OPERATOR", "UnaryOperator", ""); - if(keyType.isObject()) - { - if(!valueType.isObject()) addSimpleMapper("VALUE_CONSUMER", valueType.getFileType()+"Consumer"); - else addSimpleMapper("VALUE_CONSUMER", "Consumer"); - addSimpleMapper("CONSUMER", "Consumer"); - addSimpleMapper("IARRAY", "IObjectArray"); - } - else - { - if(valueType.isObject()) - { - addSimpleMapper("VALUE_CONSUMER", "Consumer"); - addSimpleMapper("CONSUMER", keyType.getFileType()+"Consumer"); - } - else addClassMapper("CONSUMER", "Consumer"); - addFunctionMappers("IARRAY", "I%sArray"); - } - addSimpleMapper("VALUE_COMPARATOR", valueType.isObject() ? "Comparator" : String.format("%sComparator", valueType.getNonFileType())); - addSimpleMapper("COMPARATOR", keyType.isObject() ? "Comparator" : String.format("%sComparator", keyType.getNonFileType())); - } +package speiger.src.builder.modules; + +import java.util.Arrays; +import java.util.List; + +import speiger.src.builder.ClassType; +import speiger.src.builder.RequiredType; +import speiger.src.builder.dependencies.IDependency; +import speiger.src.builder.dependencies.ModuleDependency; + +@SuppressWarnings("javadoc") +public class FunctionModule extends BaseModule +{ + public static final BaseModule INSTANCE = new FunctionModule(); + public static final ModuleDependency MODULE = new ModuleDependency(INSTANCE, false).addKeyDependency(JavaModule.MODULE); + + @Override + public String getModuleName() { return "Function"; } + @Override + public boolean isBiModule() { return true; } + @Override + protected void loadVariables() {} + @Override + protected void loadFlags() {} + @Override + protected void loadTestClasses() {} + + @Override + public List getDependencies(ClassType keyType, ClassType valueType) { + return Arrays.asList(MODULE); + } + + @Override + protected void loadBlockades() + { + if(keyType.isObject()) addBlockedFiles("Consumer", "Comparator"); + if(!MODULE.isEnabled()) addBlockedFiles("Consumer", "BiConsumer", "Comparator", "Supplier", "Optional", "Function", "UnaryOperator"); + if(!keyType.needsCustomJDKType()) addBlockedFiles("Optional"); + } + + @Override + protected void loadRemappers() + { + addBiRequirement("BiConsumer", ""); + addBiRequirement("UnaryOperator", ""); + if(valueType == ClassType.BOOLEAN) { + addRequirement("Function", "%1$s", RequiredType.BI_CLASS); + addRemapper("Function", (keyType.isObject() ? "" : "%s")+"Predicate"); + } + else if(keyType.isObject() && !valueType.isObject()) { + addRequirement("Function", "%2$s", RequiredType.BI_CLASS); + addRemapper("Function", "To%sFunction"); + } + else if(keyType == valueType) { + addRequirement("Function", "%1$s", RequiredType.BI_CLASS); + addRemapper("Function", (keyType.isObject() ? "" : "%s")+"UnaryOperator"); + } + else if(valueType.isObject()) { + addRequirement("Function", "%1$s", RequiredType.BI_CLASS); + addRemapper("Function", "%sFunction"); + } + else addBiRequirement("Function"); + addRemapper("BiConsumer", "%sConsumer"); + addRemapper("Optional", "Optional%s"); + } + + @Override + protected void loadFunctions() + { + addSimpleMapper("APPLY", keyType.getApply(valueType)); + addSimpleMapper("SUPPLY_GET", keyType.isObject() ? "get" : "getAs"+keyType.getNonFileType()); + addSimpleMapper("VALUE_SUPPLY_GET", valueType.isObject() ? "get" : "getAs"+valueType.getNonFileType()); + } + + @Override + protected void loadClasses() + { + //Interfaces + addBiClassMapper("BI_CONSUMER", "Consumer", ""); + addClassMapper("BI_TO_OBJECT_CONSUMER", "ObjectConsumer"); + addAbstractMapper("BI_FROM_OBJECT_CONSUMER", "Object%sConsumer"); + addAbstractMapper("BI_TO_OBJECT_CONSUMER", "%sObjectConsumer"); + addAbstractMapper("BI_FROM_INT_CONSUMER", "Int%sConsumer"); + if(keyType.isObject()) { + addSimpleMapper("TO_OBJECT_FUNCTION", keyType.getNonFileType()+"UnaryOperator"); + addSimpleMapper("VALUE_TO_OBJECT_FUNCTION", valueType.isObject() ? "UnaryOperator" : valueType.getFileType()+"Function"); + } + else { + addSimpleMapper("TO_OBJECT_FUNCTION", keyType.getNonFileType()+"Function"); + addSimpleMapper("VALUE_TO_OBJECT_FUNCTION", valueType.isObject() ? "UnaryOperator" : valueType.getFileType()+"Function"); + } + if(valueType == ClassType.BOOLEAN) addFunctionMappers("FUNCTION", "%sPredicate"); + else if(keyType.isObject() && !valueType.isObject()) addFunctionValueMappers("FUNCTION", "To%sFunction"); + else if(keyType == valueType) addFunctionMappers("FUNCTION", "%sUnaryOperator"); + else if(valueType.isObject()) addFunctionMappers("FUNCTION", "%sFunction"); + else addBiClassMapper("FUNCTION", "Function", "2"); + + addFunctionMappers("PREDICATE", "%sPredicate"); + addClassMapper("SUPPLIER", "Supplier"); + addSimpleMapper("OPTIONAL", keyType.isObject() ? "Optional" : String.format("Optional%s", keyType.getFileType())); + addSimpleMapper("VALUE_OPTIONAL", valueType.isObject() ? "Optional" : String.format("Optional%s", valueType.getFileType())); + addAbstractMapper("SINGLE_UNARY_OPERATOR", "%1$s%1$sUnaryOperator"); + addBiClassMapper("UNARY_OPERATOR", "UnaryOperator", ""); + if(keyType.isObject()) + { + if(!valueType.isObject()) addSimpleMapper("VALUE_CONSUMER", valueType.getFileType()+"Consumer"); + else addSimpleMapper("VALUE_CONSUMER", "Consumer"); + addSimpleMapper("CONSUMER", "Consumer"); + addSimpleMapper("IARRAY", "IObjectArray"); + } + else + { + if(valueType.isObject()) + { + addSimpleMapper("VALUE_CONSUMER", "Consumer"); + addSimpleMapper("CONSUMER", keyType.getFileType()+"Consumer"); + } + else addClassMapper("CONSUMER", "Consumer"); + addFunctionMappers("IARRAY", "I%sArray"); + } + addSimpleMapper("VALUE_COMPARATOR", valueType.isObject() ? "Comparator" : String.format("%sComparator", valueType.getNonFileType())); + addSimpleMapper("COMPARATOR", keyType.isObject() ? "Comparator" : String.format("%sComparator", keyType.getNonFileType())); + } } \ No newline at end of file diff --git a/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template b/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template index a67d5f9..0f59587 100644 --- a/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template +++ b/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template @@ -39,6 +39,9 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL; import speiger.src.collections.PACKAGE.functions.function.TO_OBJECT_FUNCTION; import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER; import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER; +#if !TYPE_OBJECT +import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER; +#endif #if !JDK_FUNCTION import speiger.src.collections.PACKAGE.functions.function.PREDICATE; #endif @@ -153,6 +156,18 @@ public interface ITERABLE KEY_GENERIC_TYPE extends Iterable iterator().forEachRemaining(input, action); } + /** + * Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner. + * @param action The action to be performed for each element + * @param input the object that should be included + * @param the generic type of the Object + * @throws java.lang.NullPointerException if the specified action is null + */ + default void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) { + Objects.requireNonNull(action); + iterator().forEachRemaining(action, input); + } + #if SPLIT_ITERATOR_FEATURE /** * A Type Specific Type Splititerator to reduce boxing/unboxing diff --git a/src/builder/resources/speiger/assets/collections/templates/collections/Iterator.template b/src/builder/resources/speiger/assets/collections/templates/collections/Iterator.template index a41dcca..b7bf1fe 100644 --- a/src/builder/resources/speiger/assets/collections/templates/collections/Iterator.template +++ b/src/builder/resources/speiger/assets/collections/templates/collections/Iterator.template @@ -1,93 +1,108 @@ -package speiger.src.collections.PACKAGE.collections; - -import java.util.Iterator; -import java.util.Objects; -#if !TYPE_OBJECT -import java.util.function.Consumer; - -import speiger.src.collections.PACKAGE.functions.CONSUMER; - -#endif -import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER; - -/** - * A Type-Specific {@link Iterator} that reduces (un)boxing - * @Type(T) - */ -public interface ITERATOR KEY_GENERIC_TYPE extends Iterator -{ -#if !TYPE_OBJECT - /** - * Returns the next element in the iteration. - * - * @return the next element in the iteration - * @throws java.util.NoSuchElementException if the iteration has no more elements - * @see Iterator#next() - */ - public KEY_TYPE NEXT(); - - /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific function. - * @deprecated Please use the corresponding type-specific function instead. - */ - @Override - @Deprecated - public default CLASS_TYPE next() { return KEY_TO_OBJ(NEXT()); } - - /** - * Performs the given action for each remaining element until all elements - * have been processed or the action throws an exception. Actions are - * performed in the order of iteration, if that order is specified. - * Exceptions thrown by the action are relayed to the caller. - * - * @implSpec - *

The default implementation behaves as if: - *

{@code
-	 *	while (hasNext()) action.accept(NEXT());
-	 * }
- * - * @param action The action to be performed for each element - * @throws java.lang.NullPointerException if the specified action is null - * @see Iterator#forEachRemaining(Consumer) - */ - public default void forEachRemaining(CONSUMER action) { - Objects.requireNonNull(action); - while(hasNext()) { action.accept(NEXT()); } - } - - /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific function. - * @deprecated Please use the corresponding type-specific function instead. - */ - @Deprecated - @Override - default void forEachRemaining(Consumer action) { - Objects.requireNonNull(action); - forEachRemaining(action::accept); - } - -#endif - /** - * Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner. - * @param input the object that should be included - * @param action The action to be performed for each element - * @param the generic type of the Object - * @throws java.lang.NullPointerException if the specified action is null - */ - default void forEachRemaining(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) { - Objects.requireNonNull(action); - while(hasNext()) { action.accept(input, NEXT()); } - } - - /** - * Skips the Given amount of elements if possible. A Optimization function to skip elements faster if the implementation allows it. - * @param amount the amount of elements that should be skipped - * @return the amount of elements that were skipped - */ - default int skip(int amount) { - if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed"); - int i = 0; - for(;i +{ +#if !TYPE_OBJECT + /** + * Returns the next element in the iteration. + * + * @return the next element in the iteration + * @throws java.util.NoSuchElementException if the iteration has no more elements + * @see Iterator#next() + */ + public KEY_TYPE NEXT(); + + /** {@inheritDoc} + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. + */ + @Override + @Deprecated + public default CLASS_TYPE next() { return KEY_TO_OBJ(NEXT()); } + + /** + * Performs the given action for each remaining element until all elements + * have been processed or the action throws an exception. Actions are + * performed in the order of iteration, if that order is specified. + * Exceptions thrown by the action are relayed to the caller. + * + * @implSpec + *

The default implementation behaves as if: + *

{@code
+	 *	while (hasNext()) action.accept(NEXT());
+	 * }
+ * + * @param action The action to be performed for each element + * @throws java.lang.NullPointerException if the specified action is null + * @see Iterator#forEachRemaining(Consumer) + */ + public default void forEachRemaining(CONSUMER action) { + Objects.requireNonNull(action); + while(hasNext()) { action.accept(NEXT()); } + } + + /** {@inheritDoc} + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. + */ + @Deprecated + @Override + default void forEachRemaining(Consumer action) { + Objects.requireNonNull(action); + forEachRemaining(action::accept); + } + +#endif + /** + * Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner. + * @param input the object that should be included + * @param action The action to be performed for each element + * @param the generic type of the Object + * @throws java.lang.NullPointerException if the specified action is null + */ + default void forEachRemaining(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) { + Objects.requireNonNull(action); + while(hasNext()) { action.accept(input, NEXT()); } + } + + /** + * Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner. + * @param action The action to be performed for each element + * @param input the object that should be included + * @param the generic type of the Object + * @throws java.lang.NullPointerException if the specified action is null + */ + default void forEachRemaining(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) { + Objects.requireNonNull(action); + while(hasNext()) { action.accept(NEXT(), input); } + } + + /** + * Skips the Given amount of elements if possible. A Optimization function to skip elements faster if the implementation allows it. + * @param amount the amount of elements that should be skipped + * @return the amount of elements that were skipped + */ + default int skip(int amount) { + if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed"); + int i = 0; + for(;i void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) { Objects.requireNonNull(action); for(int i = 0;i void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) { + Objects.requireNonNull(action); + for(int i = 0;i void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) { + Objects.requireNonNull(action); + KEY_TYPE[] data = this.data; + for(int i = 0,m=data.length;i c) { - data = ARRAYS.pour(ITERATORS.wrap(c.iterator())); - } - - /** - * Creates a new Immutable copy of the contents of the Collection. - * @param c the elements that should be added into the list - */ - public IMMUTABLE_LIST(COLLECTION KEY_GENERIC_TYPE c) { - data = ARRAYS.pour(c.iterator()); - } - - /** - * Creates a new Immutable copy of the contents of the List. - * @param l the elements that should be added into the list - */ - public IMMUTABLE_LIST(LIST KEY_GENERIC_TYPE l) { - KEY_TYPE[] temp = NEW_KEY_ARRAY(l.size()); - l.getElements(0, temp, 0, l.size()); - data = temp; - } - - /** - * Creates a new Immutable copy of the contents of the Array. - * @param a the array that should be copied - */ - public IMMUTABLE_LIST(KEY_TYPE... a) { - this(a, 0, a.length); - } - - /** - * Creates a new ImmutableList copy of the array with a custom length - * @param a the array that should be copied - * @param length the desired length that should be copied - */ - public IMMUTABLE_LIST(KEY_TYPE[] a, int length) { - this(a, 0, length); - } - - /** - * Creates a new ImmutableList copy of the array with in the custom range. - * @param a the array that should be copied - * @param offset the starting offset of where the array should be copied from - * @param length the desired length that should be copied - * @throws IllegalStateException if offset is smaller then 0 - * @throws IllegalStateException if the offset + length exceeds the array length - */ - public IMMUTABLE_LIST(KEY_TYPE[] a, int offset, int length) { - SanityChecks.checkArrayCapacity(a.length, offset, length); - data = Arrays.copyOfRange(a, offset, offset+length); - } - -#if JDK_TYPE && SPLIT_ITERATOR_FEATURE && STREAM_FEATURE -#if TYPE_OBJECT - /** - * Creates a Collector for a ImmutableList - * @Type(T) - * @return a collector - */ - public static Collector, ImmutableObjectList> toList() { - return Collector.of(COLLECTIONS::wrapper, COLLECTION::add, ImmutableObjectList::merge, E -> new IMMUTABLE_LIST<>(E.toArray((T[])new Object[E.size()]))); - } - - /** - * Collects a Stream to a ImmutableList - * @Type(T) - * @return a list with the contents of the Stream - */ - public static ImmutableObjectList KEY_GENERIC_TYPE toList(Stream stream) { - return stream.collect(toList()); - } - - private static COLLECTION merge(COLLECTION a, COLLECTION b) { - a.addAll(b); - return a; - } - -#else - /** - * Collects a Stream to a ImmutableList - * @return a list with the contents of the Stream - */ - public static IMMUTABLE_LIST toList(JAVA_STREAM stream) { - return new IMMUTABLE_LIST(stream.collect((Supplier)COLLECTIONS::wrapper, COLLECTION::add, COLLECTION::addAll).TO_ARRAY()); - } - -#endif -#endif - @Override - public boolean add(KEY_TYPE e) { throw new UnsupportedOperationException(); } - @Override - public void add(int index, KEY_TYPE e) { throw new UnsupportedOperationException(); } - @Override - @Primitive - public boolean addAll(int index, Collection c) { throw new UnsupportedOperationException(); } - @Override - public boolean addAll(int index, COLLECTION KEY_GENERIC_TYPE c) { throw new UnsupportedOperationException(); } - @Override - public boolean addAll(int index, LIST KEY_GENERIC_TYPE c) { throw new UnsupportedOperationException(); } - @Override - public boolean addAll(KEY_TYPE[] e, int offset, int length) { throw new UnsupportedOperationException(); } - @Override - public void addElements(int from, KEY_TYPE[] a, int offset, int length) { throw new UnsupportedOperationException(); } - - @Override - public KEY_TYPE[] getElements(int from, KEY_TYPE[] a, int offset, int length) { - SanityChecks.checkArrayCapacity(a.length, offset, length); - SanityChecks.checkArrayCapacity(data.length, from, length); - System.arraycopy(data, from, a, offset, length); - return a; - } - - @Override - public void removeElements(int from, int to) { throw new UnsupportedOperationException(); } -#if TYPE_OBJECT - @Override - public K[] extractElements(int from, int to, Class type) { throw new UnsupportedOperationException(); } - -#else - @Override - public KEY_TYPE[] extractElements(int from, int to) { throw new UnsupportedOperationException(); } - -#endif - - /** - * A function to find if the Element is present in this list. - * @param o the element that is searched for - * @return if the element was found. - */ - @Override - @Primitive - public boolean contains(Object o) { - return indexOf(o) != -1; - } - - /** - * A function to find the index of a given element - * @param o the element that is searched for - * @return the index of the element if found. (if not found then -1) - */ - @Override - @Primitive - public int indexOf(Object o) { -#if TYPE_OBJECT - if(o == null) { - for(int i = 0,m=data.length;i=0;i--) - if(data[i] == null) return i; - return -1; - } -#else - if(o == null) return -1; -#endif - for(int i = data.length - 1;i>=0;i--) { - if(EQUALS_KEY_TYPE(data[i], o)) return i; - } - return -1; - } - -#if TYPE_OBJECT - @Override - public void sort(Comparator c) { throw new UnsupportedOperationException(); } - @Override - public void unstableSort(Comparator c) { throw new UnsupportedOperationException(); } - -#else - /** - * A Type Specific implementation of the Collection#contains function. - * @param e the element that is searched for. - * @return if the element was found - */ - @Override - public boolean contains(KEY_TYPE e) { - return indexOf(e) != -1; - } - - /** - * A Type-Specific function to find the index of a given element - * @param e the element that is searched for - * @return the index of the element if found. (if not found then -1) - */ - @Override - public int indexOf(KEY_TYPE e) { - for(int i = 0,m=data.length;i=0;i--) { - if(KEY_EQUALS(data[i], e)) return i; - } - return -1; - } - - @Override - public void sort(COMPARATOR c) { throw new UnsupportedOperationException(); } - @Override - public void unstableSort(COMPARATOR c) { throw new UnsupportedOperationException(); } - -#endif - /** - * A Type-Specific get function to reduce (un)boxing - * @param index the index of the element to fetch - * @return the value of the requested index - * @throws IndexOutOfBoundsException if the index is out of range - */ - @Override - public KEY_TYPE GET_KEY(int index) { - checkRange(index); - return data[index]; - } - - @Override - public IMMUTABLE_LIST KEY_GENERIC_TYPE copy() { - return new IMMUTABLE_LISTBRACES(Arrays.copyOf(data, data.length)); - } - - /** - * A Type Specific foreach function that reduces (un)boxing - * - * @implSpec - *

The default implementation behaves as if: - *

{@code
-	 * 	for(int i = 0;i
-	 *
-	 * @param action The action to be performed for each element
-	 * @throws NullPointerException if the specified action is null
-	 * @see Iterable#forEach(java.util.function.Consumer)
-	 */
-	@Override
-	public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
-		Objects.requireNonNull(action);
-		for(int i = 0,m=data.length;i void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) {
-		Objects.requireNonNull(action);
-		for(int i = 0,m=data.length;i KEY_SPECIAL_TYPE reduce(KEY_SPECIAL_TYPE identity, BiFunction operator) {
-		Objects.requireNonNull(operator);
-		KEY_SPECIAL_TYPE state = identity;
-		for(int i = 0,m=data.length;i size()) throw new IndexOutOfBoundsException();
-		return new LIST_ITER(index);
-	}
-	
-	@Override
-	public KEY_TYPE set(int index, KEY_TYPE e) { throw new UnsupportedOperationException(); }
-	@Override
-	@Primitive
-	public void replaceAll(UnaryOperator o) { throw new UnsupportedOperationException(); }
-#if PRIMITIVES
-	@Override
-	public void REPLACE(JAVA_UNARY_OPERATOR o) { throw new UnsupportedOperationException(); }
-#endif
-	@Override
-	public KEY_TYPE REMOVE(int index) { throw new UnsupportedOperationException(); }
-	@Override
-	public KEY_TYPE swapRemove(int index) { throw new UnsupportedOperationException(); }
-#if !TYPE_OBJECT
-	@Override
-	public boolean REMOVE_KEY(KEY_TYPE type) { throw new UnsupportedOperationException(); }
-
-#endif
-	@Override
-	@Primitive
-	public boolean removeAll(Collection c) { throw new UnsupportedOperationException(); }
-	@Override
-	@Primitive
-	public boolean retainAll(Collection c) { throw new UnsupportedOperationException(); }
-	@Override
-	@Primitive
-	public boolean removeIf(Predicate filter) { throw new UnsupportedOperationException(); }
-	@Override
-	public boolean removeAll(COLLECTION KEY_GENERIC_TYPE c) { throw new UnsupportedOperationException(); }
-	@Override
-	public boolean retainAll(COLLECTION KEY_GENERIC_TYPE c) { throw new UnsupportedOperationException(); }
-	@Override
-	public boolean removeAll(COLLECTION KEY_GENERIC_TYPE c, CONSUMER KEY_GENERIC_TYPE r) { throw new UnsupportedOperationException(); }
-	@Override
-	public boolean retainAll(COLLECTION KEY_GENERIC_TYPE c, CONSUMER KEY_GENERIC_TYPE r) { throw new UnsupportedOperationException(); }
-	
-#if PRIMITIVES
-	@Override
-	public boolean remIf(JAVA_PREDICATE filter) { throw new UnsupportedOperationException(); }
-	
-#endif
-	/**
-	 * A toArray implementation that ensures the Array itself is a Object.
-	 * @return a Array of the elements in the list
-	 */
-	@Override
-	@Primitive
-	public Object[] toArray() {
-		if(data.length == 0) return ObjectArrays.EMPTY_ARRAY;
-		Object[] obj = new Object[data.length];
-		for(int i = 0,m=data.length;i E[] toArray(E[] a) {
-		if(a == null) a = (E[])new Object[data.length];
-		else if(a.length < data.length) a = (E[])ObjectArrays.newArray(a.getClass().getComponentType(), data.length);
-		for(int i = 0,m=data.length;i data.length) a[data.length] = null;
-		return a;
-	}
-	
-#if !TYPE_OBJECT
-	@Override
-	public KEY_TYPE[] TO_ARRAY(KEY_TYPE[] a) {
-		if(a.length < data.length) a = new KEY_TYPE[data.length];
-		System.arraycopy(data, 0, a, 0, data.length);
-		if (a.length > data.length) a[data.length] = EMPTY_KEY_VALUE;
-		return a;
-	}
-	
-#endif
-	/**
-	 * A function to return the size of the list
-	 * @return the size of elements in the list
-	 */
-	@Override
-	public int size() {
-		return data.length;
-	}
-	
-	@Override
-	public void size(int size) { throw new UnsupportedOperationException(); }
-	@Override
-	public void clear() { throw new UnsupportedOperationException(); }
-	
-	protected void checkRange(int index) {
-		if (index < 0 || index >= data.length)
-			throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + data.length);
-	}
-	
-#if SPLIT_ITERATOR_FEATURE
-#if PRIMITIVES && STREAM_FEATURE
-	/**
-	 * Returns a Java-Type-Specific Stream to reduce boxing/unboxing.
-	 * @return a Stream of the closest java type
-	 * @note characteristics are ordered, sized, subsized
-	 */
-	@Override
-	public JAVA_STREAM primitiveStream() { return StreamSupport.NEW_STREAM(SPLIT_ITERATORS.createArrayJavaSplititerator(data, data.length, 16464), false); }
-	
-#endif
-	/**
-	 * A Type Specific Type Splititerator to reduce boxing/unboxing
-	 * @return type specific splititerator
-	 * @note characteristics are ordered, sized, subsized
-	 */
-	@Override
-	public SPLIT_ITERATOR KEY_GENERIC_TYPE spliterator() { return SPLIT_ITERATORS.createArraySplititerator(data, data.length, 16464); }
-	
-#endif
-	private class LIST_ITER implements LIST_ITERATOR KEY_GENERIC_TYPE {
-		int index;
-		
-		LIST_ITER(int index) {
-			this.index = index;
-		}
-		
-		@Override
-		public boolean hasNext() {
-			return index < size();
-		}
-		
-		@Override
-		public KEY_TYPE NEXT() {
-			if(!hasNext()) throw new NoSuchElementException();
-			return GET_KEY(index++);
-		}
-		
-		@Override
-		public boolean hasPrevious() {
-			return index > 0;
-		}
-		
-		@Override
-		public KEY_TYPE PREVIOUS() {
-			if(!hasPrevious()) throw new NoSuchElementException();
-			return GET_KEY(--index);
-		}
-		
-		@Override
-		public int nextIndex() {
-			return index;
-		}
-		
-		@Override
-		public int previousIndex() {
-			return index-1;
-		}
-		
-		@Override
-		public void remove() { throw new UnsupportedOperationException(); }
-		
-		@Override
-		public void set(KEY_TYPE e) { throw new UnsupportedOperationException(); }
-		
-		@Override
-		public void add(KEY_TYPE e) { throw new UnsupportedOperationException(); }
-		
-		@Override
-		public int skip(int amount) {
-			if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed");
-			int steps = Math.min(amount, size() - index);
-			index += steps;
-			return steps;
-		}
-		
-		@Override
-		public int back(int amount) {
-			if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed");
-			int steps = Math.min(amount, index);
-			index -= steps;
-			return steps;
-		}
-	}
+package speiger.src.collections.PACKAGE.lists;
+
+import java.util.Arrays;
+#if TYPE_OBJECT
+import java.util.Comparator;
+#else if !TYPE_BOOLEAN
+import java.util.stream.JAVA_STREAM;
+import java.util.stream.StreamSupport;
+#endif
+import java.util.Collection;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+#if JDK_TYPE
+import java.util.OPTIONAL;
+#if SPLIT_ITERATOR_FEATURE && STREAM_FEATURE
+#if PRIMITIVES
+import java.util.function.Supplier;
+#else
+import java.util.stream.Stream;
+import java.util.stream.Collector;
+#endif
+
+import speiger.src.collections.PACKAGE.utils.COLLECTIONS;
+#endif
+#endif
+#if TYPE_OBJECT
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
+#endif
+import java.util.function.Predicate;
+import java.util.function.UnaryOperator;
+#if !TYPE_OBJECT && JDK_FUNCTION
+import java.util.function.PREDICATE;
+#endif
+#if PRIMITIVES
+#if !JDK_FUNCTION
+import java.util.function.JAVA_PREDICATE;
+#endif
+
+import java.util.function.JAVA_UNARY_OPERATOR;
+#endif
+
+import speiger.src.collections.PACKAGE.collections.COLLECTION;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.COMPARATOR;
+import speiger.src.collections.PACKAGE.functions.CONSUMER;
+#if !JDK_TYPE 
+import speiger.src.collections.PACKAGE.functions.OPTIONAL;
+#endif
+import speiger.src.collections.PACKAGE.utils.ARRAYS;
+#endif
+import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
+import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
+#if !JDK_FUNCTION
+import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
+#endif
+import speiger.src.collections.PACKAGE.functions.function.UNARY_OPERATOR;
+import speiger.src.collections.objects.utils.ObjectArrays;
+import speiger.src.collections.PACKAGE.utils.ITERATORS;
+#if SPLIT_ITERATOR_FEATURE
+import speiger.src.collections.PACKAGE.collections.SPLIT_ITERATOR;
+import speiger.src.collections.PACKAGE.utils.SPLIT_ITERATORS;
+#endif
+import speiger.src.collections.utils.SanityChecks;
+
+#if TYPE_OBJECT
+/**
+ * A Type-Specific Immutable implementation of list that is written to reduce (un)boxing
+ *
+ * @Type(T)
+ */
+public class IMMUTABLE_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
+#else
+/**
+ * A Type-Specific Immutable implementation of list that is written to reduce (un)boxing
+ */
+public class IMMUTABLE_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
+#endif
+{	
+	/** The backing array */
+	protected transient KEY_TYPE[] data;
+	
+	/**
+	 * Creates a new Immutable copy of the contents of the Collection.
+	 * @param c the elements that should be added into the list
+	 */
+	@Primitive
+	public IMMUTABLE_LIST(Collection c) {
+		data = ARRAYS.pour(ITERATORS.wrap(c.iterator()));
+	}
+	
+	/**
+	 * Creates a new Immutable copy of the contents of the Collection.
+	 * @param c the elements that should be added into the list
+	 */
+	public IMMUTABLE_LIST(COLLECTION KEY_GENERIC_TYPE c) {
+		data = ARRAYS.pour(c.iterator());
+	}
+	
+	/**
+	 * Creates a new Immutable copy of the contents of the List.
+	 * @param l the elements that should be added into the list
+	 */
+	public IMMUTABLE_LIST(LIST KEY_GENERIC_TYPE l) {
+		KEY_TYPE[] temp = NEW_KEY_ARRAY(l.size());
+		l.getElements(0, temp, 0, l.size());
+		data = temp;
+	}
+	
+	/**
+	 * Creates a new Immutable copy of the contents of the Array.
+	 * @param a the array that should be copied
+	 */
+	public IMMUTABLE_LIST(KEY_TYPE... a) {
+		this(a, 0, a.length);
+	}
+	
+	/**
+	 * Creates a new ImmutableList copy of the array with a custom length
+	 * @param a the array that should be copied
+	 * @param length the desired length that should be copied
+	 */
+	public IMMUTABLE_LIST(KEY_TYPE[] a, int length) {
+		this(a, 0, length);
+	}
+	
+	/**
+	 * Creates a new ImmutableList copy of the array with in the custom range.
+	 * @param a the array that should be copied
+	 * @param offset the starting offset of where the array should be copied from
+	 * @param length the desired length that should be copied
+	 * @throws IllegalStateException if offset is smaller then 0
+	 * @throws IllegalStateException if the offset + length exceeds the array length
+	 */
+	public IMMUTABLE_LIST(KEY_TYPE[] a, int offset, int length) {
+		SanityChecks.checkArrayCapacity(a.length, offset, length);
+		data = Arrays.copyOfRange(a, offset, offset+length);
+	}
+	
+#if JDK_TYPE && SPLIT_ITERATOR_FEATURE && STREAM_FEATURE
+#if TYPE_OBJECT
+	/**
+	 * Creates a Collector for a ImmutableList
+	 * @Type(T)
+	 * @return a collector
+	 */
+	public static  Collector, ImmutableObjectList> toList() {
+		return Collector.of(COLLECTIONS::wrapper, COLLECTION::add, ImmutableObjectList::merge, E -> new IMMUTABLE_LIST<>(E.toArray((T[])new Object[E.size()])));
+	}
+
+	/**
+	 * Collects a Stream to a ImmutableList
+	 * @Type(T)
+	 * @return a list with the contents of the Stream
+	 */
+	public static  ImmutableObjectList KEY_GENERIC_TYPE toList(Stream stream) {
+		return stream.collect(toList());
+	}
+	
+	private static  COLLECTION merge(COLLECTION a, COLLECTION b) {
+		a.addAll(b);
+		return a;
+	}
+	
+#else
+	/**
+	 * Collects a Stream to a ImmutableList
+	 * @return a list with the contents of the Stream
+	 */
+	public static IMMUTABLE_LIST toList(JAVA_STREAM stream) {
+		return new IMMUTABLE_LIST(stream.collect((Supplier)COLLECTIONS::wrapper, COLLECTION::add, COLLECTION::addAll).TO_ARRAY());
+	}
+	
+#endif
+#endif
+	@Override
+	public boolean add(KEY_TYPE e) { throw new UnsupportedOperationException(); }
+	@Override
+	public void add(int index, KEY_TYPE e) { throw new UnsupportedOperationException(); }
+	@Override
+	@Primitive
+	public boolean addAll(int index, Collection c) { throw new UnsupportedOperationException(); }
+	@Override
+	public boolean addAll(int index, COLLECTION KEY_GENERIC_TYPE c) { throw new UnsupportedOperationException(); }
+	@Override
+	public boolean addAll(int index, LIST KEY_GENERIC_TYPE c) { throw new UnsupportedOperationException(); }
+	@Override
+	public boolean addAll(KEY_TYPE[] e, int offset, int length) { throw new UnsupportedOperationException(); }
+	@Override
+	public void addElements(int from, KEY_TYPE[] a, int offset, int length) { throw new UnsupportedOperationException(); }
+	
+	@Override
+	public KEY_TYPE[] getElements(int from, KEY_TYPE[] a, int offset, int length) {
+		SanityChecks.checkArrayCapacity(a.length, offset, length);
+		SanityChecks.checkArrayCapacity(data.length, from, length);
+		System.arraycopy(data, from, a, offset, length);
+		return a;
+	}
+	
+	@Override
+	public void removeElements(int from, int to) { throw new UnsupportedOperationException(); }
+#if TYPE_OBJECT
+	@Override
+	public  K[] extractElements(int from, int to, Class type) { throw new UnsupportedOperationException(); }
+	
+#else
+	@Override
+	public KEY_TYPE[] extractElements(int from, int to) { throw new UnsupportedOperationException(); }
+	
+#endif
+	
+	/**
+	 * A function to find if the Element is present in this list.
+	 * @param o the element that is searched for
+	 * @return if the element was found.
+	 */
+	@Override
+	@Primitive
+	public boolean contains(Object o) {
+		return indexOf(o) != -1;
+	}
+	
+	/**
+	 * A function to find the index of a given element
+	 * @param o the element that is searched for
+	 * @return the index of the element if found. (if not found then -1)
+	 */
+	@Override
+	@Primitive
+	public int indexOf(Object o) {
+#if TYPE_OBJECT
+		if(o == null) {
+			for(int i = 0,m=data.length;i=0;i--)
+				if(data[i] == null) return i;
+			return -1;
+		}
+#else
+		if(o == null) return -1;
+#endif
+		for(int i = data.length - 1;i>=0;i--) {
+			if(EQUALS_KEY_TYPE(data[i], o)) return i;
+		}
+		return -1;
+	}
+	
+#if TYPE_OBJECT
+	@Override
+	public void sort(Comparator c) { throw new UnsupportedOperationException(); }
+	@Override
+	public void unstableSort(Comparator c) { throw new UnsupportedOperationException(); }
+	
+#else
+	/**
+	 * A Type Specific implementation of the Collection#contains function.
+	 * @param e the element that is searched for.
+	 * @return if the element was found
+	 */
+	@Override
+	public boolean contains(KEY_TYPE e) {
+		return indexOf(e) != -1;
+	}
+	
+	/**
+	 * A Type-Specific function to find the index of a given element
+	 * @param e the element that is searched for
+	 * @return the index of the element if found. (if not found then -1)
+	 */
+	@Override
+	public int indexOf(KEY_TYPE e) {
+		for(int i = 0,m=data.length;i=0;i--) {
+			if(KEY_EQUALS(data[i], e)) return i;
+		}
+		return -1;
+	}
+	
+	@Override
+	public void sort(COMPARATOR c) { throw new UnsupportedOperationException(); }
+	@Override
+	public void unstableSort(COMPARATOR c) { throw new UnsupportedOperationException(); }
+	
+#endif
+	/**
+	 * A Type-Specific get function to reduce (un)boxing
+	 * @param index the index of the element to fetch
+	 * @return the value of the requested index
+	 * @throws IndexOutOfBoundsException if the index is out of range
+	 */
+	@Override
+	public KEY_TYPE GET_KEY(int index) {
+		checkRange(index);
+		return data[index];
+	}
+	
+	@Override
+	public IMMUTABLE_LIST KEY_GENERIC_TYPE copy() {
+		return new IMMUTABLE_LISTBRACES(Arrays.copyOf(data, data.length));
+	}
+	
+	/**
+	 * A Type Specific foreach function that reduces (un)boxing
+	 * 
+	 * @implSpec
+	 * 

The default implementation behaves as if: + *

{@code
+	 * 	for(int i = 0;i
+	 *
+	 * @param action The action to be performed for each element
+	 * @throws NullPointerException if the specified action is null
+	 * @see Iterable#forEach(java.util.function.Consumer)
+	 */
+	@Override
+	public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
+		Objects.requireNonNull(action);
+		for(int i = 0,m=data.length;i void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) {
+		Objects.requireNonNull(action);
+		for(int i = 0,m=data.length;i void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		for(int i = 0,m=data.length;i KEY_SPECIAL_TYPE reduce(KEY_SPECIAL_TYPE identity, BiFunction operator) {
+		Objects.requireNonNull(operator);
+		KEY_SPECIAL_TYPE state = identity;
+		for(int i = 0,m=data.length;i size()) throw new IndexOutOfBoundsException();
+		return new LIST_ITER(index);
+	}
+	
+	@Override
+	public KEY_TYPE set(int index, KEY_TYPE e) { throw new UnsupportedOperationException(); }
+	@Override
+	@Primitive
+	public void replaceAll(UnaryOperator o) { throw new UnsupportedOperationException(); }
+#if PRIMITIVES
+	@Override
+	public void REPLACE(JAVA_UNARY_OPERATOR o) { throw new UnsupportedOperationException(); }
+#endif
+	@Override
+	public KEY_TYPE REMOVE(int index) { throw new UnsupportedOperationException(); }
+	@Override
+	public KEY_TYPE swapRemove(int index) { throw new UnsupportedOperationException(); }
+#if !TYPE_OBJECT
+	@Override
+	public boolean REMOVE_KEY(KEY_TYPE type) { throw new UnsupportedOperationException(); }
+
+#endif
+	@Override
+	@Primitive
+	public boolean removeAll(Collection c) { throw new UnsupportedOperationException(); }
+	@Override
+	@Primitive
+	public boolean retainAll(Collection c) { throw new UnsupportedOperationException(); }
+	@Override
+	@Primitive
+	public boolean removeIf(Predicate filter) { throw new UnsupportedOperationException(); }
+	@Override
+	public boolean removeAll(COLLECTION KEY_GENERIC_TYPE c) { throw new UnsupportedOperationException(); }
+	@Override
+	public boolean retainAll(COLLECTION KEY_GENERIC_TYPE c) { throw new UnsupportedOperationException(); }
+	@Override
+	public boolean removeAll(COLLECTION KEY_GENERIC_TYPE c, CONSUMER KEY_GENERIC_TYPE r) { throw new UnsupportedOperationException(); }
+	@Override
+	public boolean retainAll(COLLECTION KEY_GENERIC_TYPE c, CONSUMER KEY_GENERIC_TYPE r) { throw new UnsupportedOperationException(); }
+	
+#if PRIMITIVES
+	@Override
+	public boolean remIf(JAVA_PREDICATE filter) { throw new UnsupportedOperationException(); }
+	
+#endif
+	/**
+	 * A toArray implementation that ensures the Array itself is a Object.
+	 * @return a Array of the elements in the list
+	 */
+	@Override
+	@Primitive
+	public Object[] toArray() {
+		if(data.length == 0) return ObjectArrays.EMPTY_ARRAY;
+		Object[] obj = new Object[data.length];
+		for(int i = 0,m=data.length;i E[] toArray(E[] a) {
+		if(a == null) a = (E[])new Object[data.length];
+		else if(a.length < data.length) a = (E[])ObjectArrays.newArray(a.getClass().getComponentType(), data.length);
+		for(int i = 0,m=data.length;i data.length) a[data.length] = null;
+		return a;
+	}
+	
+#if !TYPE_OBJECT
+	@Override
+	public KEY_TYPE[] TO_ARRAY(KEY_TYPE[] a) {
+		if(a.length < data.length) a = new KEY_TYPE[data.length];
+		System.arraycopy(data, 0, a, 0, data.length);
+		if (a.length > data.length) a[data.length] = EMPTY_KEY_VALUE;
+		return a;
+	}
+	
+#endif
+	/**
+	 * A function to return the size of the list
+	 * @return the size of elements in the list
+	 */
+	@Override
+	public int size() {
+		return data.length;
+	}
+	
+	@Override
+	public void size(int size) { throw new UnsupportedOperationException(); }
+	@Override
+	public void clear() { throw new UnsupportedOperationException(); }
+	
+	protected void checkRange(int index) {
+		if (index < 0 || index >= data.length)
+			throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + data.length);
+	}
+	
+#if SPLIT_ITERATOR_FEATURE
+#if PRIMITIVES && STREAM_FEATURE
+	/**
+	 * Returns a Java-Type-Specific Stream to reduce boxing/unboxing.
+	 * @return a Stream of the closest java type
+	 * @note characteristics are ordered, sized, subsized
+	 */
+	@Override
+	public JAVA_STREAM primitiveStream() { return StreamSupport.NEW_STREAM(SPLIT_ITERATORS.createArrayJavaSplititerator(data, data.length, 16464), false); }
+	
+#endif
+	/**
+	 * A Type Specific Type Splititerator to reduce boxing/unboxing
+	 * @return type specific splititerator
+	 * @note characteristics are ordered, sized, subsized
+	 */
+	@Override
+	public SPLIT_ITERATOR KEY_GENERIC_TYPE spliterator() { return SPLIT_ITERATORS.createArraySplititerator(data, data.length, 16464); }
+	
+#endif
+	private class LIST_ITER implements LIST_ITERATOR KEY_GENERIC_TYPE {
+		int index;
+		
+		LIST_ITER(int index) {
+			this.index = index;
+		}
+		
+		@Override
+		public boolean hasNext() {
+			return index < size();
+		}
+		
+		@Override
+		public KEY_TYPE NEXT() {
+			if(!hasNext()) throw new NoSuchElementException();
+			return GET_KEY(index++);
+		}
+		
+		@Override
+		public boolean hasPrevious() {
+			return index > 0;
+		}
+		
+		@Override
+		public KEY_TYPE PREVIOUS() {
+			if(!hasPrevious()) throw new NoSuchElementException();
+			return GET_KEY(--index);
+		}
+		
+		@Override
+		public int nextIndex() {
+			return index;
+		}
+		
+		@Override
+		public int previousIndex() {
+			return index-1;
+		}
+		
+		@Override
+		public void remove() { throw new UnsupportedOperationException(); }
+		
+		@Override
+		public void set(KEY_TYPE e) { throw new UnsupportedOperationException(); }
+		
+		@Override
+		public void add(KEY_TYPE e) { throw new UnsupportedOperationException(); }
+		
+		@Override
+		public int skip(int amount) {
+			if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed");
+			int steps = Math.min(amount, size() - index);
+			index += steps;
+			return steps;
+		}
+		
+		@Override
+		public int back(int amount) {
+			if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed");
+			int steps = Math.min(amount, index);
+			index -= steps;
+			return steps;
+		}
+	}
 }
\ No newline at end of file
diff --git a/src/builder/resources/speiger/assets/collections/templates/lists/LinkedList.template b/src/builder/resources/speiger/assets/collections/templates/lists/LinkedList.template
index aa749f8..f83e7d3 100644
--- a/src/builder/resources/speiger/assets/collections/templates/lists/LinkedList.template
+++ b/src/builder/resources/speiger/assets/collections/templates/lists/LinkedList.template
@@ -47,6 +47,9 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 #endif
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_FUNCTION
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
@@ -512,6 +515,13 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
 			action.accept(input, entry.value);		
 	}
 	
+	@Override
+	public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		for(Entry KEY_GENERIC_TYPE entry = first;entry != null;entry = entry.next)
+			action.accept(entry.value, input);
+	}
+	
 	@Override
 	public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 		Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/concurrent/ConcurrentOpenHashMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/concurrent/ConcurrentOpenHashMap.template
index ef9974a..45fa79d 100644
--- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/concurrent/ConcurrentOpenHashMap.template
+++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/concurrent/ConcurrentOpenHashMap.template
@@ -25,15 +25,20 @@ import speiger.src.collections.PACKAGE.collections.ITERATOR;
 #endif
 import speiger.src.collections.PACKAGE.functions.CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !VALUE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
 #endif
+#endif
+#if !TYPE_INT || !SAME_TYPE
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
-#if !TYPE_OBJECT && !VALUE_OBJECT
+#endif
+#if !TYPE_OBJECT && !VALUE_OBJECT && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
 #endif
 #if !SAME_TYPE && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
 #endif
-#if !TYPE_INT || !SAME_TYPE
+#if !TYPE_INT || !SAME_TYPE || !VALUE_OBJECT
 import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
 #endif
 #if !VALUE_BOOLEAN || !JDK_TYPE
@@ -82,6 +87,9 @@ import speiger.src.collections.objects.functions.consumer.ObjectObjectConsumer;
 #if !TYPE_OBJECT
 import speiger.src.collections.objects.functions.consumer.VALUE_BI_FROM_OBJECT_CONSUMER;
 #endif
+#if !VALUE_OBJECT && !VALUE_INT
+import speiger.src.collections.VALUE_PACKAGE.functions.consumer.VALUE_BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_VALUE
 import speiger.src.collections.VALUE_PACKAGE.functions.function.VALUE_PREDICATE;
 import speiger.src.collections.VALUE_PACKAGE.functions.VALUE_OPTIONAL;
@@ -758,6 +766,25 @@ public class CONCURRENT_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY
 			}
 		}
 		
+		@Override
+		public  void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			for(int i = 0,m=segments.length;i filter) {
 			Objects.requireNonNull(filter);
@@ -1087,6 +1114,25 @@ public class CONCURRENT_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY
 			}
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(int i = 0,m=segments.length;i void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(int i = 0,m=segments.length;i void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1) {
+				action.accept(new ValueMapEntry(index), input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(Predicate filter) {
 			Objects.requireNonNull(filter);
@@ -1108,6 +1127,17 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
 			}
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1){
+				action.accept(keys[index], input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
@@ -1291,6 +1321,17 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
 			}
 		}
 		
+		@Override
+		public  void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1){
+				action.accept(values[index], input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/customHash/OpenCustomHashMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/customHash/OpenCustomHashMap.template
index 97012e8..f63f13f 100644
--- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/customHash/OpenCustomHashMap.template
+++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/customHash/OpenCustomHashMap.template
@@ -22,15 +22,20 @@ import java.util.VALUE_OPTIONAL;
 import speiger.src.collections.PACKAGE.collections.ITERATOR;
 import speiger.src.collections.PACKAGE.functions.CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !VALUE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
 #endif
+#endif
+#if !TYPE_INT || !SAME_TYPE
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
-#if !TYPE_OBJECT && !VALUE_OBJECT
+#endif
+#if !TYPE_OBJECT && !VALUE_OBJECT && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
 #endif
 #if !SAME_TYPE && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
 #endif
-#if !TYPE_INT || !SAME_TYPE
+#if !TYPE_INT || !SAME_TYPE || !VALUE_OBJECT
 import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
 #endif
 #if !VALUE_BOOLEAN || !JDK_TYPE
@@ -77,7 +82,9 @@ import speiger.src.collections.objects.functions.consumer.ObjectObjectConsumer;
 #if !SAME_TYPE
 #if !TYPE_OBJECT
 import speiger.src.collections.objects.functions.consumer.VALUE_BI_FROM_OBJECT_CONSUMER;
-
+#endif
+#if !VALUE_OBJECT && !VALUE_INT
+import speiger.src.collections.VALUE_PACKAGE.functions.consumer.VALUE_BI_TO_OBJECT_CONSUMER;
 #endif
 #if !JDK_VALUE
 import speiger.src.collections.VALUE_PACKAGE.functions.function.VALUE_PREDICATE;
@@ -1030,6 +1037,16 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
 			}
 		}
 		
+		@Override
+		public  void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			if(containsNull) action.accept(new ValueMapEntry(nullIndex), input);
+			for(int i = nullIndex-1;i>=0;i--) {
+				if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(new ValueMapEntry(i), input);
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(Predicate filter) {
 			Objects.requireNonNull(filter);
@@ -1277,6 +1294,16 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
 			}
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			if(containsNull) action.accept(keys[nullIndex], input);
+			for(int i = nullIndex-1;i>=0;i--) {
+				if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(keys[i], input);
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
@@ -1443,6 +1470,16 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
 			}
 		}
 		
+		@Override
+		public  void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			if(containsNull) action.accept(values[nullIndex], input);
+			for(int i = nullIndex-1;i>=0;i--) {
+				if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(values[i], input);
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/LinkedOpenHashMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/LinkedOpenHashMap.template
index 535f4ae..fa3de03 100644
--- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/LinkedOpenHashMap.template
+++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/LinkedOpenHashMap.template
@@ -21,9 +21,14 @@ import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
 #if !TYPE_OBJECT
 import speiger.src.collections.PACKAGE.functions.CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !VALUE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
 #endif
+#endif
+#if !TYPE_INT || !SAME_TYPE
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
-#if !TYPE_OBJECT && !VALUE_OBJECT
+#endif
+#if !TYPE_OBJECT && !VALUE_OBJECT && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
 #endif
 #if !SAME_TYPE && !TYPE_INT
@@ -33,7 +38,7 @@ import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUME
 import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
-#if !TYPE_INT || !SAME_TYPE
+#if !TYPE_INT || !SAME_TYPE || !VALUE_OBJECT
 import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
 #endif
 import speiger.src.collections.PACKAGE.functions.function.SINGLE_UNARY_OPERATOR;
@@ -58,7 +63,9 @@ import speiger.src.collections.objects.functions.consumer.ObjectObjectConsumer;
 #if !SAME_TYPE
 #if !TYPE_OBJECT
 import speiger.src.collections.objects.functions.consumer.VALUE_BI_FROM_OBJECT_CONSUMER;
-
+#endif
+#if !VALUE_OBJECT && !VALUE_INT
+import speiger.src.collections.VALUE_PACKAGE.functions.consumer.VALUE_BI_TO_OBJECT_CONSUMER;
 #endif
 #if !JDK_VALUE
 import speiger.src.collections.VALUE_PACKAGE.functions.function.VALUE_PREDICATE;
@@ -831,6 +838,17 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
 			}
 		}
 		
+		@Override
+		public  void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1) {
+				action.accept(new ValueMapEntry(index), input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(Predicate filter) {
 			Objects.requireNonNull(filter);
@@ -1110,6 +1128,17 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
 			}
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1){
+				action.accept(keys[index], input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
@@ -1295,6 +1324,17 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
 			}
 		}
 		
+		@Override
+		public  void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1){
+				action.accept(values[index], input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template
index a3676a5..eb9bef3 100644
--- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template
+++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template
@@ -22,15 +22,20 @@ import java.util.VALUE_OPTIONAL;
 import speiger.src.collections.PACKAGE.collections.ITERATOR;
 import speiger.src.collections.PACKAGE.functions.CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !VALUE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
 #endif
+#endif
+#if !TYPE_INT || !SAME_TYPE
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
-#if !TYPE_OBJECT && !VALUE_OBJECT
+#endif
+#if !TYPE_OBJECT && !VALUE_OBJECT && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
 #endif
 #if !SAME_TYPE && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUMER;
 #endif
-#if !TYPE_INT || !SAME_TYPE
+#if !TYPE_INT || !SAME_TYPE || !VALUE_OBJECT
 import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
 #endif
 #if !VALUE_BOOLEAN || !JDK_TYPE
@@ -76,7 +81,9 @@ import speiger.src.collections.objects.functions.consumer.ObjectObjectConsumer;
 #if !TYPE_OBJECT
 import speiger.src.collections.objects.functions.consumer.VALUE_BI_FROM_OBJECT_CONSUMER;
 #endif
-
+#if !VALUE_OBJECT && !VALUE_INT
+import speiger.src.collections.VALUE_PACKAGE.functions.consumer.VALUE_BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_VALUE
 import speiger.src.collections.VALUE_PACKAGE.functions.function.VALUE_PREDICATE;
 import speiger.src.collections.VALUE_PACKAGE.functions.VALUE_OPTIONAL;
@@ -989,6 +996,16 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
 			}
 		}
 		
+		@Override
+		public  void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			if(containsNull) action.accept(new ValueMapEntry(nullIndex), input);
+			for(int i = nullIndex-1;i>=0;i--) {
+				if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(new ValueMapEntry(i), input);
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(Predicate filter) {
 			Objects.requireNonNull(filter);
@@ -1232,6 +1249,16 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
 			}
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			if(containsNull) action.accept(keys[nullIndex], input);
+			for(int i = nullIndex-1;i>=0;i--) {
+				if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(keys[i], input);
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
@@ -1398,6 +1425,16 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
 			}
 		}
 		
+		@Override
+		public  void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			if(containsNull) action.accept(values[nullIndex], input);
+			for(int i = nullIndex-1;i>=0;i--) {
+				if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(values[i], input);
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/immutable/ImmutableOpenHashMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/immutable/ImmutableOpenHashMap.template
index c9936fe..7b0e8fb 100644
--- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/immutable/ImmutableOpenHashMap.template
+++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/immutable/ImmutableOpenHashMap.template
@@ -21,9 +21,14 @@ import java.util.VALUE_OPTIONAL;
 import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
 import speiger.src.collections.PACKAGE.functions.CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !VALUE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
 #endif
+#endif
+#if !TYPE_INT || !SAME_TYPE
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
-#if !TYPE_OBJECT && !VALUE_OBJECT
+#endif
+#if !TYPE_OBJECT && !VALUE_OBJECT && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
 #endif
 #if !SAME_TYPE && !TYPE_INT
@@ -35,7 +40,7 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
 #endif
-#if !TYPE_INT || !SAME_TYPE
+#if !TYPE_INT || !SAME_TYPE || !VALUE_OBJECT
 import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
 #endif
 #if !VALUE_BOOLEAN || !JDK_TYPE
@@ -82,6 +87,9 @@ import speiger.src.collections.VALUE_PACKAGE.functions.VALUE_CONSUMER;
 import speiger.src.collections.VALUE_PACKAGE.lists.VALUE_LIST_ITERATOR;
 import speiger.src.collections.VALUE_PACKAGE.utils.VALUE_ARRAYS;
 #endif
+#if !VALUE_OBJECT && !VALUE_INT
+import speiger.src.collections.VALUE_PACKAGE.functions.consumer.VALUE_BI_TO_OBJECT_CONSUMER;
+#endif
 #endif
 import speiger.src.collections.objects.collections.ObjectBidirectionalIterator;
 #if !TYPE_OBJECT
@@ -739,6 +747,17 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
 			}
 		}
 		
+		@Override
+		public  void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1) {
+				action.accept(new BasicEntryKV_BRACES(keys[index], values[index]), input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(Predicate filter) {
 			Objects.requireNonNull(filter);
@@ -990,6 +1009,17 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
 			}
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1){
+				action.accept(keys[index], input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
@@ -1166,6 +1196,17 @@ public class IMMUTABLE_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_
 			}
 		}
 		
+		@Override
+		public  void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			if(size() <= 0) return;
+			int index = firstIndex;
+			while(index != -1){
+				action.accept(values[index], input);
+				index = (int)links[index];
+			}
+		}
+		
 		@Override
 		public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template
index b69a432..1bb5a6f 100644
--- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template
+++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template
@@ -21,9 +21,14 @@ import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
 #if !TYPE_OBJECT
 import speiger.src.collections.PACKAGE.functions.CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !VALUE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
 #endif
+#endif
+#if !TYPE_INT || !SAME_TYPE
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
-#if !TYPE_OBJECT && !VALUE_OBJECT
+#endif
+#if !TYPE_OBJECT && !VALUE_OBJECT && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
 #endif
 #if !SAME_TYPE && !TYPE_INT
@@ -35,7 +40,7 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
 #endif
-#if !TYPE_INT || !SAME_TYPE
+#if !TYPE_INT || !SAME_TYPE || !VALUE_OBJECT
 import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
 #endif
 #if !VALUE_BOOLEAN || !JDK_TYPE
@@ -66,9 +71,12 @@ import speiger.src.collections.VALUE_PACKAGE.lists.VALUE_LIST_ITERATOR;
 import speiger.src.collections.objects.functions.consumer.ObjectObjectConsumer;
 #endif
 #if !SAME_TYPE
-#if VALUE_OBJECT
+#if !TYPE_OBJECT
 import speiger.src.collections.objects.functions.consumer.VALUE_BI_FROM_OBJECT_CONSUMER;
 
+#endif
+#if !VALUE_OBJECT && !VALUE_INT
+import speiger.src.collections.VALUE_PACKAGE.functions.consumer.VALUE_BI_TO_OBJECT_CONSUMER;
 #endif
 #if !JDK_VALUE
 import speiger.src.collections.VALUE_PACKAGE.functions.function.VALUE_PREDICATE;
@@ -972,6 +980,13 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
 				action.accept(input, new ValueMapEntry(i));
 			}
 		}
+		@Override
+		public  void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			for(int i = 0;i filter) {
@@ -1181,6 +1196,12 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN
 			for(int i = 0;i void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(int i = 0;i void forEach(E input, VALUE_BI_FROM_OBJECT_CONSUMER VSV_GENERIC_TYPE action) {
+			Objects.requireNonNull(action);
+			for(int i = 0;i void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(int i = 0;i void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(Node KEY_VALUE_GENERIC_TYPE entry = start(), end = end();entry != null && (end == null || (end != previous(entry)));entry = next(entry))
+				action.accept(entry.key, input);
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
@@ -1986,6 +2001,13 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
 					action.accept(input, new BasicEntryKV_BRACES(entry.key, entry.value));
 			}
 			
+			@Override
+			public  void forEach(ObjectObjectConsumer action, E input) {
+				Objects.requireNonNull(action);
+				for(Node KEY_VALUE_GENERIC_TYPE entry = subLowest(), last = subHighest();entry != null && (last == null || last != previous(entry));entry = next(entry))
+					action.accept(new BasicEntryKV_BRACES(entry.key, entry.value), input);
+			}
+			
 			@Override
 			public boolean matchesAny(Predicate filter) {
 				Objects.requireNonNull(filter);
@@ -2126,6 +2148,13 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
 					action.accept(input, entry.value);
 			}
 			
+			@Override
+			public  void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+				Objects.requireNonNull(action);
+				for(Node KEY_VALUE_GENERIC_TYPE entry = subLowest(), last = subHighest();entry != null && (last == null || last != previous(entry));entry = next(entry))
+					action.accept(entry.value, input);
+			}
+			
 			@Override
 			public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
 				Objects.requireNonNull(filter);
@@ -2647,6 +2676,13 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_
 				action.accept(input, new BasicEntryKV_BRACES(entry.key, entry.value));
 		}
 		
+		@Override
+		public  void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			for(Node KEY_VALUE_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
+				action.accept(new BasicEntryKV_BRACES(entry.key, entry.value), input);
+		}
+		
 		@Override
 		public boolean matchesAny(Predicate filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template
index 68bc672..0444cd9 100644
--- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template
+++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template
@@ -25,9 +25,14 @@ import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
 import speiger.src.collections.PACKAGE.functions.COMPARATOR;
 import speiger.src.collections.PACKAGE.functions.CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !VALUE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
 #endif
+#endif
+#if !TYPE_INT || !SAME_TYPE
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
-#if !TYPE_OBJECT && !VALUE_OBJECT
+#endif
+#if !TYPE_OBJECT && !VALUE_OBJECT && !TYPE_INT
 import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
 #endif
 #if !SAME_TYPE && !TYPE_INT
@@ -36,7 +41,7 @@ import speiger.src.collections.ints.functions.consumer.VALUE_BI_FROM_INT_CONSUME
 #if !VALUE_BOOLEAN || !JDK_TYPE
 import speiger.src.collections.PACKAGE.functions.function.FUNCTION;
 #endif
-#if !TYPE_INT || !SAME_TYPE
+#if !TYPE_INT || !SAME_TYPE || !VALUE_OBJECT
 import speiger.src.collections.PACKAGE.functions.consumer.BI_CONSUMER;
 #endif
 #if !TYPE_OBJECT && !JDK_TYPE
@@ -74,7 +79,9 @@ import speiger.src.collections.objects.functions.consumer.ObjectObjectConsumer;
 #if !SAME_TYPE
 #if !TYPE_OBJECT
 import speiger.src.collections.objects.functions.consumer.VALUE_BI_FROM_OBJECT_CONSUMER;
-
+#endif
+#if !VALUE_OBJECT && !VALUE_INT
+import speiger.src.collections.VALUE_PACKAGE.functions.consumer.VALUE_BI_TO_OBJECT_CONSUMER;
 #endif
 #if !JDK_VALUE
 import speiger.src.collections.VALUE_PACKAGE.functions.function.VALUE_PREDICATE;
@@ -1340,6 +1347,13 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
 				action.accept(input, entry.key);
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(Node KEY_VALUE_GENERIC_TYPE entry = start(), end = end();entry != null && (end == null || (end != previous(entry)));entry = next(entry))
+				action.accept(entry.key, input);
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
@@ -2052,6 +2066,13 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
 					action.accept(input, new BasicEntryKV_BRACES(entry.key, entry.value));
 			}
 			
+			@Override
+			public  void forEach(ObjectObjectConsumer action, E input) {
+				Objects.requireNonNull(action);
+				for(Node KEY_VALUE_GENERIC_TYPE entry = subLowest(), last = subHighest();entry != null && (last == null || last != previous(entry));entry = next(entry))
+					action.accept(new BasicEntryKV_BRACES(entry.key, entry.value), input);
+			}
+			
 			@Override
 			public boolean matchesAny(Predicate filter) {
 				Objects.requireNonNull(filter);
@@ -2192,6 +2213,13 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
 					action.accept(input, entry.value);
 			}
 			
+			@Override
+			public  void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+				Objects.requireNonNull(action);
+				for(Node KEY_VALUE_GENERIC_TYPE entry = subLowest(), last = subHighest();entry != null && (last == null || last != previous(entry));entry = next(entry))
+					action.accept(entry.value, input);
+			}
+			
 			@Override
 			public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
 				Objects.requireNonNull(filter);
@@ -2548,6 +2576,13 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
 				action.accept(input, entry.value);
 		}
 		
+		@Override
+		public  void forEach(VALUE_BI_TO_OBJECT_CONSUMER VVS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(Node KEY_VALUE_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
+				action.accept(entry.value, input);
+		}
+		
 		@Override
 		public boolean matchesAny(VALUE_PREDICATE VALUE_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
@@ -2713,6 +2748,13 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
 				action.accept(input, new BasicEntryKV_BRACES(entry.key, entry.value));
 		}
 		
+		@Override
+		public  void forEach(ObjectObjectConsumer action, E input) {
+			Objects.requireNonNull(action);
+			for(Node KEY_VALUE_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
+				action.accept(new BasicEntryKV_BRACES(entry.key, entry.value), input);
+		}
+		
 		@Override
 		public boolean matchesAny(Predicate filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template
index 1fbefd8..0d17b28 100644
--- a/src/builder/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template
+++ b/src/builder/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template
@@ -33,6 +33,9 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 #endif
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_FUNCTION
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
@@ -425,6 +428,13 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
 			action.accept(input, entry.key);		
 	}
 	
+	@Override
+	public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		for(Entry KEY_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
+			action.accept(entry.key, input);
+	}
+	
 	@Override
 	public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 		Objects.requireNonNull(filter);
@@ -1311,6 +1321,13 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
 				action.accept(input, entry.key);		
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(Entry KEY_GENERIC_TYPE entry = start();entry != null && inRange(entry.key);entry = next(entry))
+				action.accept(entry.key, input);
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/sets/ArraySet.template b/src/builder/resources/speiger/assets/collections/templates/sets/ArraySet.template
index 9aacaca..6b29863 100644
--- a/src/builder/resources/speiger/assets/collections/templates/sets/ArraySet.template
+++ b/src/builder/resources/speiger/assets/collections/templates/sets/ArraySet.template
@@ -1,758 +1,768 @@
-package speiger.src.collections.PACKAGE.sets;
-
-import java.util.Arrays;
-import java.util.Collection;
-#if TYPE_OBJECT
-import java.util.function.Consumer;
-import java.util.function.BiFunction;
-#endif
-import java.util.NoSuchElementException;
-import java.util.Objects;
-#if JDK_TYPE
-import java.util.OPTIONAL;
-#if !TYPE_OBJECT
-import java.util.stream.JAVA_STREAM;
-#else
-import java.util.stream.Stream;
-import java.util.stream.Collector;
-#endif
-#endif
-import java.util.Set;
-#if JDK_FUNCTION
-import java.util.function.PREDICATE;
-#endif
-#if PRIMITIVES && !JDK_FUNCTION
-import java.util.function.JAVA_PREDICATE;
-#endif
-import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
-import speiger.src.collections.PACKAGE.collections.COLLECTION;
-import speiger.src.collections.PACKAGE.collections.ITERATOR;
-#if !JDK_TYPE 
-import speiger.src.collections.PACKAGE.functions.OPTIONAL;
-#endif
-import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
-import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
-#if !JDK_FUNCTION
-import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
-#endif
-import speiger.src.collections.PACKAGE.functions.function.UNARY_OPERATOR;
-#if !TYPE_OBJECT
-import speiger.src.collections.PACKAGE.functions.CONSUMER;
-import speiger.src.collections.objects.utils.ObjectArrays;
-#endif
-import speiger.src.collections.PACKAGE.lists.LIST_ITERATOR;
-import speiger.src.collections.PACKAGE.utils.ARRAYS;
-
-
-/**
- * A Type Specific ArraySet implementation.
- * That is based around the idea of {@link java.util.List#indexOf(Object)} for no duplication.
- * Unless a array constructor is used the ArraySet does not allow for duplication.
- * This implementation does not shrink the backing array
- * @Type(T)
- */
-public class ARRAY_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE implements ORDERED_SET KEY_GENERIC_TYPE
-{
-	/** The Backing Array */
-	protected transient KEY_TYPE[] data;
-	/** The amount of elements stored in the array*/
-	protected int size = 0;
-	
-	/**
-	 * Default Constructor
-	 */
-	public ARRAY_SET() {
-		data = EMPTY_KEY_ARRAY;
-	}
-	
-	/**
-	 * Minimum Capacity Constructor
-	 * @param capacity the minimum capacity of the internal array
-	 * @throws NegativeArraySizeException if the capacity is negative
-	 */
-	public ARRAY_SET(int capacity) {
-		if(capacity < 0) throw new IllegalStateException("Size has to be 0 or greater");
-		data = NEW_KEY_ARRAY(capacity);
-	}
-	
-	/**
-	 * Constructur using initial Array
-	 * @param array the array that should be used for set.
-	 */
-	public ARRAY_SET(KEY_TYPE[] array) {
-		this(array, 0, array.length);
-	}
-	
-	/**
-	 * Constructur using initial Array
-	 * @param array the array that should be used for set.
-	 * @param length the amount of elements present within the array
-	 * @throws NegativeArraySizeException if the length is negative
-	 */
-	public ARRAY_SET(KEY_TYPE[] array, int length) {
-		this(length);
-		addAll(array, length);
-	}
-	
-	/**
-	 * Constructur using initial Array
-	 * @param array the array that should be used for set.
-	 * @param offset the starting offset of where the array should be copied from
-	 * @param length the amount of elements present within the array
-	 * @throws NegativeArraySizeException if the length is negative
-	 */
-	public ARRAY_SET(KEY_TYPE[] array, int offset, int length) {
-		this(length);
-		addAll(array, offset, length);
-	}
-	
-	/**
-	 * A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
-	 * @param c the elements that should be added to the set.
-	 * @note this slowly checks every element to remove duplicates
-	 */
-	@Primitive
-	public ARRAY_SET(Collection c) {
-		this(c.size());
-		addAll(c);
-	}
-	
-	/**
-	 * A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
-	 * @param c the elements that should be added to the set.
-	 * @note this slowly checks every element to remove duplicates
-	 */
-	public ARRAY_SET(COLLECTION KEY_GENERIC_TYPE c) {
-		this(c.size());
-		addAll(c);
-	}
-	
-	/**
-	 * A Helper constructor that fast copies the element out of a set into the ArraySet.
-	 * Since it is assumed that there is no duplication in the first place
-	 * @param s the set the element should be taken from
-	 */
-	@Primitive
-	public ARRAY_SET(Set s) {
-		this(s.size());
-		for(CLASS_TYPE e : s)
-			data[size++] = OBJ_TO_KEY(e);
-	}
-	
-	/**
-	 * A Helper constructor that fast copies the element out of a set into the ArraySet.
-	 * Since it is assumed that there is no duplication in the first place
-	 * @param s the set the element should be taken from
-	 */
-	public ARRAY_SET(SET KEY_GENERIC_TYPE s) {
-		this(s.size());
-		for(ITERATOR KEY_GENERIC_TYPE iter = s.iterator();iter.hasNext();data[size++] = iter.NEXT());
-	}
-	
-#if JDK_TYPE && SPLIT_ITERATOR_FEATURE && STREAM_FEATURE
-#if TYPE_OBJECT
-	/**
-	 * Creates a Collector for a ArraySet
-	 * @Type(T)
-	 * @return a collector
-	 */
-	public static  Collector, ARRAY_SET> toList() {
-		return Collector.of(ARRAY_SET::new, ARRAY_SET::add, ARRAY_SET::merge);
-	}
-	
-	/**
-	 * Collects a Stream to a ArraySet
-	 * @Type(T)
-	 * @return a set with the contents of the Stream
-	 */
-	public static  ARRAY_SET KEY_GENERIC_TYPE toList(Stream stream) {
-		return stream.collect(ARRAY_SET::new, ARRAY_SET::add, ARRAY_SET::merge);
-	}
-	
-	private ARRAY_SET merge(ARRAY_SET a) {
-		addAll(a);
-		return this;
-	}
-	
-#else
-	/**
-	 * Collects a Stream to a ArraySet
-	 * @return a set with the contents of the Stream
-	 */
-	public static ARRAY_SET toList(JAVA_STREAM stream) {
-		return stream.collect(ARRAY_SET::new, ARRAY_SET::add, ARRAY_SET::addAll);
-	}
-	
-#endif
-#endif
-	@Override
-	public boolean add(KEY_TYPE o) {
-		int index = findIndex(o);
-		if(index == -1) {
-			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
-			data[size++] = o;
-			return true;
-		}
-		return false;
-	}
-	
-#if TYPE_OBJECT
-	@Override
-	public KEY_TYPE addOrGet(KEY_TYPE o) {
-		int index = findIndex(o);
-		if(index != -1) return data[index];
-		if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
-		data[size++] = o;
-		return o;
-	}
-	
-#endif
-	@Override
-	public void addFirst(KEY_TYPE o) {
-		int index = findIndex(o);
-		if(index == -1) {
-			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
-			System.arraycopy(data, 0, data, 1, size++);
-			data[0] = o;
-		}
-	}
-	
-	@Override
-	public void addLast(KEY_TYPE o) {
-		int index = findIndex(o);
-		if(index == -1) {
-			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
-			data[size++] = o;
-		}
-	}
-	
-	@Override
-	public boolean addAndMoveToFirst(KEY_TYPE o) {
-		int index = findIndex(o);
-		if(index == -1) {
-			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
-			System.arraycopy(data, 0, data, 1, size++);
-			data[0] = o;
-			return true;
-		}
-		else if(index != 0) {
-			o = data[index];
-			System.arraycopy(data, 0, data, 1, index);
-			data[0] = o;
-		}
-		return false;
-	}
-
-	@Override
-	public boolean addAndMoveToLast(KEY_TYPE o) {
-		int index = findIndex(o);
-		if(index == -1) {
-			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
-			data[size++] = o;
-			return true;
-		}
-		else if(index != size - 1) {
-			o = data[index];
-			System.arraycopy(data, index+1, data, index, size - index - 1);
-			data[size-1] = o;
-		}
-		return false;
-	}
-
-	@Override
-	public boolean moveToFirst(KEY_TYPE o) {
-		int index = findIndex(o);
-		if(index > 0) {
-			o = data[index];
-			System.arraycopy(data, 0, data, 1, index);
-			data[0] = o;
-			return true;
-		}
-		return false;
-	}
-
-	@Override
-	public boolean moveToLast(KEY_TYPE o) {
-		int index = findIndex(o);
-		if(index != -1 && index != size - 1) {
-			o = data[index];
-			System.arraycopy(data, index+1, data, index, size - index - 1);
-			data[size-1] = o;
-			return true;
-		}
-		return false;
-	}
-	
-#if !TYPE_OBJECT
-	@Override
-	public boolean contains(KEY_TYPE e) {
-		return findIndex(e) != -1;
-	}
-	
-#else
-	@Override
-	public boolean contains(Object e) {
-		return findIndex(e) != -1;
-	}
-	
-#endif
-	@Override
-	public KEY_TYPE GET_FIRST_KEY() {
-		if(size == 0) throw new NoSuchElementException();
-		return data[0];
-	}
-	
-	@Override
-	public KEY_TYPE GET_LAST_KEY() {
-		if(size == 0) throw new NoSuchElementException();
-		return data[size - 1];
-	}
-	
-	@Override
-	public boolean removeAll(COLLECTION KEY_GENERIC_TYPE c) {
-		int j = 0;
-		for(int i = 0;i c) {
-		int j = 0;
-		for(int i = 0;i c) {
-		int j = 0;
-		for(int i = 0;i void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) {
-		Objects.requireNonNull(action);
-		for(int i = 0;i KEY_SPECIAL_TYPE reduce(KEY_SPECIAL_TYPE identity, BiFunction operator) {
-		Objects.requireNonNull(operator);
-		KEY_SPECIAL_TYPE state = identity;
-		for(int i = 0;i=0;i--)
-			if(KEY_EQUALS(data[i], o)) return i;
-		return -1;
-	}
-	
-#endif
-	protected int findIndex(Object o) {
-		for(int i = size-1;i>=0;i--)
-			if(EQUALS_KEY_TYPE(data[i], o)) return i;
-		return -1;
-	}
-	
-	@Override
-	public BI_ITERATOR KEY_GENERIC_TYPE iterator() {
-		return new SetIterator(true, 0);
-	}
-	
-	@Override
-	public BI_ITERATOR KEY_GENERIC_TYPE reverseIterator() {
-		return new SetIterator(false, size);
-	}
-	
-	@Override
-	public BI_ITERATOR KEY_GENERIC_TYPE iterator(KEY_TYPE fromElement) {
-		int index = findIndex(fromElement);
-		if(index != -1) return new SetIterator(true, index);
-		throw new NoSuchElementException();
-	}
-	
-	public ARRAY_SET KEY_GENERIC_TYPE copy() {
-		ARRAY_SET KEY_GENERIC_TYPE set = new ARRAY_SETBRACES();
-		set.data = Arrays.copyOf(data, data.length);
-		set.size = size;
-		return set;
-	}
-	
-	@Override
-	public void clear() {
-		size = 0;
-	}
-	
-	@Override
-	public int size() {
-		return size;
-	}
-	
-#if !TYPE_OBJECT
-	@Override
-	public KEY_TYPE[] TO_ARRAY(KEY_TYPE[] a) {
-		if(a == null || a.length < size()) return Arrays.copyOf(data, size());
-		System.arraycopy(data, 0, a, 0, size());
-		if (a.length > size) a[size] = EMPTY_KEY_VALUE;
-		return a;
-	}
-	
-#endif
-	@Override
-	@Deprecated
-	public Object[] toArray() {
-		if(isEmpty()) return ObjectArrays.EMPTY_ARRAY;
-		Object[] obj = new Object[size()];
-		for(int i = 0;i E[] toArray(E[] a) {
-		if(a == null) a = (E[])new Object[size()];
-		else if(a.length < size()) a = (E[])ObjectArrays.newArray(a.getClass().getComponentType(), size());
-		for(int i = 0;i size) a[size] = null;
-		return a;
-	}
-		
-	private class SetIterator implements LIST_ITERATOR KEY_GENERIC_TYPE {
-		boolean forward;
-		int index;
-		int lastReturned = -1;
-		
-		public SetIterator(boolean forward, int index) {
-			this.forward = forward;
-			this.index = index;
-		}
-		
-		@Override
-		public boolean hasNext() {
-			return forward ? index < size() : index > 0;
-		}
-		
-		@Override
-		public KEY_TYPE NEXT() {
-			if(!hasNext()) throw new NoSuchElementException();
-			if(forward) {
-				lastReturned = index;
-				return data[index++];				
-			}
-			index--;
-			return data[(lastReturned = index)];
-		}
-		
-		@Override
-		public boolean hasPrevious() {
-			return forward ? index > 0 : index < size();
-		}
-		
-		@Override
-		public KEY_TYPE PREVIOUS() {
-			if(!hasPrevious()) throw new NoSuchElementException();
-			if(forward) {
-				index--;
-				return data[(lastReturned = index)];
-			}
-			lastReturned = index;
-			return data[index++];
-		}
-		
-		@Override
-		public int nextIndex() {
-			if(forward) return index;
-			return size - index;
-		}
-		
-		@Override
-		public int previousIndex() {
-			if(forward) return index-1;
-			return (size - index)-1;
-		}
-		
-		@Override
-		public void remove() {
-			if(lastReturned == -1) throw new IllegalStateException();
-			ARRAY_SET.this.remove(data[lastReturned]);
-			if(lastReturned < index) index--;
-			lastReturned = -1;
-		}
-		
-#if TYPE_OBJECT
-		@Override
-		public void set(Object e) { throw new UnsupportedOperationException(); }
-		
-		@Override
-		public void add(Object e) { throw new UnsupportedOperationException(); }
-		
-#else
-		@Override
-		public void set(KEY_TYPE e) { throw new UnsupportedOperationException(); }
-
-		@Override
-		public void add(KEY_TYPE e) { throw new UnsupportedOperationException(); }
-		
-#endif
-		@Override
-		public int skip(int amount) {
-			if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed");
-			return forward ? moveForward(amount) : moveBackwards(amount);
-		}
-		
-		@Override
-		public int back(int amount) {
-			if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed");
-			return forward ? moveBackwards(amount) : moveForward(amount);
-		}
-		
-		private int moveForward(int amount) {
-			int steps = Math.min(amount, size() - index);
-			index += steps;
-			if(steps > 0) lastReturned = Math.min(index-1, size()-1);
-			return steps;
-		}
-		
-		private int moveBackwards(int amount) {
-			int steps = Math.min(amount, index);
-			index -= steps;
-			if(steps > 0) lastReturned = Math.min(index, size()-1);
-			return steps;
-		}
-	}
-}
+package speiger.src.collections.PACKAGE.sets;
+
+import java.util.Arrays;
+import java.util.Collection;
+#if TYPE_OBJECT
+import java.util.function.Consumer;
+import java.util.function.BiFunction;
+#endif
+import java.util.NoSuchElementException;
+import java.util.Objects;
+#if JDK_TYPE
+import java.util.OPTIONAL;
+#if !TYPE_OBJECT
+import java.util.stream.JAVA_STREAM;
+#else
+import java.util.stream.Stream;
+import java.util.stream.Collector;
+#endif
+#endif
+import java.util.Set;
+#if JDK_FUNCTION
+import java.util.function.PREDICATE;
+#endif
+#if PRIMITIVES && !JDK_FUNCTION
+import java.util.function.JAVA_PREDICATE;
+#endif
+import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;
+import speiger.src.collections.PACKAGE.collections.COLLECTION;
+import speiger.src.collections.PACKAGE.collections.ITERATOR;
+#if !JDK_TYPE 
+import speiger.src.collections.PACKAGE.functions.OPTIONAL;
+#endif
+import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
+import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
+#if !JDK_FUNCTION
+import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
+#endif
+import speiger.src.collections.PACKAGE.functions.function.UNARY_OPERATOR;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.CONSUMER;
+import speiger.src.collections.objects.utils.ObjectArrays;
+#endif
+import speiger.src.collections.PACKAGE.lists.LIST_ITERATOR;
+import speiger.src.collections.PACKAGE.utils.ARRAYS;
+
+
+/**
+ * A Type Specific ArraySet implementation.
+ * That is based around the idea of {@link java.util.List#indexOf(Object)} for no duplication.
+ * Unless a array constructor is used the ArraySet does not allow for duplication.
+ * This implementation does not shrink the backing array
+ * @Type(T)
+ */
+public class ARRAY_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE implements ORDERED_SET KEY_GENERIC_TYPE
+{
+	/** The Backing Array */
+	protected transient KEY_TYPE[] data;
+	/** The amount of elements stored in the array*/
+	protected int size = 0;
+	
+	/**
+	 * Default Constructor
+	 */
+	public ARRAY_SET() {
+		data = EMPTY_KEY_ARRAY;
+	}
+	
+	/**
+	 * Minimum Capacity Constructor
+	 * @param capacity the minimum capacity of the internal array
+	 * @throws NegativeArraySizeException if the capacity is negative
+	 */
+	public ARRAY_SET(int capacity) {
+		if(capacity < 0) throw new IllegalStateException("Size has to be 0 or greater");
+		data = NEW_KEY_ARRAY(capacity);
+	}
+	
+	/**
+	 * Constructur using initial Array
+	 * @param array the array that should be used for set.
+	 */
+	public ARRAY_SET(KEY_TYPE[] array) {
+		this(array, 0, array.length);
+	}
+	
+	/**
+	 * Constructur using initial Array
+	 * @param array the array that should be used for set.
+	 * @param length the amount of elements present within the array
+	 * @throws NegativeArraySizeException if the length is negative
+	 */
+	public ARRAY_SET(KEY_TYPE[] array, int length) {
+		this(length);
+		addAll(array, length);
+	}
+	
+	/**
+	 * Constructur using initial Array
+	 * @param array the array that should be used for set.
+	 * @param offset the starting offset of where the array should be copied from
+	 * @param length the amount of elements present within the array
+	 * @throws NegativeArraySizeException if the length is negative
+	 */
+	public ARRAY_SET(KEY_TYPE[] array, int offset, int length) {
+		this(length);
+		addAll(array, offset, length);
+	}
+	
+	/**
+	 * A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
+	 * @param c the elements that should be added to the set.
+	 * @note this slowly checks every element to remove duplicates
+	 */
+	@Primitive
+	public ARRAY_SET(Collection c) {
+		this(c.size());
+		addAll(c);
+	}
+	
+	/**
+	 * A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
+	 * @param c the elements that should be added to the set.
+	 * @note this slowly checks every element to remove duplicates
+	 */
+	public ARRAY_SET(COLLECTION KEY_GENERIC_TYPE c) {
+		this(c.size());
+		addAll(c);
+	}
+	
+	/**
+	 * A Helper constructor that fast copies the element out of a set into the ArraySet.
+	 * Since it is assumed that there is no duplication in the first place
+	 * @param s the set the element should be taken from
+	 */
+	@Primitive
+	public ARRAY_SET(Set s) {
+		this(s.size());
+		for(CLASS_TYPE e : s)
+			data[size++] = OBJ_TO_KEY(e);
+	}
+	
+	/**
+	 * A Helper constructor that fast copies the element out of a set into the ArraySet.
+	 * Since it is assumed that there is no duplication in the first place
+	 * @param s the set the element should be taken from
+	 */
+	public ARRAY_SET(SET KEY_GENERIC_TYPE s) {
+		this(s.size());
+		for(ITERATOR KEY_GENERIC_TYPE iter = s.iterator();iter.hasNext();data[size++] = iter.NEXT());
+	}
+	
+#if JDK_TYPE && SPLIT_ITERATOR_FEATURE && STREAM_FEATURE
+#if TYPE_OBJECT
+	/**
+	 * Creates a Collector for a ArraySet
+	 * @Type(T)
+	 * @return a collector
+	 */
+	public static  Collector, ARRAY_SET> toList() {
+		return Collector.of(ARRAY_SET::new, ARRAY_SET::add, ARRAY_SET::merge);
+	}
+	
+	/**
+	 * Collects a Stream to a ArraySet
+	 * @Type(T)
+	 * @return a set with the contents of the Stream
+	 */
+	public static  ARRAY_SET KEY_GENERIC_TYPE toList(Stream stream) {
+		return stream.collect(ARRAY_SET::new, ARRAY_SET::add, ARRAY_SET::merge);
+	}
+	
+	private ARRAY_SET merge(ARRAY_SET a) {
+		addAll(a);
+		return this;
+	}
+	
+#else
+	/**
+	 * Collects a Stream to a ArraySet
+	 * @return a set with the contents of the Stream
+	 */
+	public static ARRAY_SET toList(JAVA_STREAM stream) {
+		return stream.collect(ARRAY_SET::new, ARRAY_SET::add, ARRAY_SET::addAll);
+	}
+	
+#endif
+#endif
+	@Override
+	public boolean add(KEY_TYPE o) {
+		int index = findIndex(o);
+		if(index == -1) {
+			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
+			data[size++] = o;
+			return true;
+		}
+		return false;
+	}
+	
+#if TYPE_OBJECT
+	@Override
+	public KEY_TYPE addOrGet(KEY_TYPE o) {
+		int index = findIndex(o);
+		if(index != -1) return data[index];
+		if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
+		data[size++] = o;
+		return o;
+	}
+	
+#endif
+	@Override
+	public void addFirst(KEY_TYPE o) {
+		int index = findIndex(o);
+		if(index == -1) {
+			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
+			System.arraycopy(data, 0, data, 1, size++);
+			data[0] = o;
+		}
+	}
+	
+	@Override
+	public void addLast(KEY_TYPE o) {
+		int index = findIndex(o);
+		if(index == -1) {
+			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
+			data[size++] = o;
+		}
+	}
+	
+	@Override
+	public boolean addAndMoveToFirst(KEY_TYPE o) {
+		int index = findIndex(o);
+		if(index == -1) {
+			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
+			System.arraycopy(data, 0, data, 1, size++);
+			data[0] = o;
+			return true;
+		}
+		else if(index != 0) {
+			o = data[index];
+			System.arraycopy(data, 0, data, 1, index);
+			data[0] = o;
+		}
+		return false;
+	}
+
+	@Override
+	public boolean addAndMoveToLast(KEY_TYPE o) {
+		int index = findIndex(o);
+		if(index == -1) {
+			if(data.length == size) data = Arrays.copyOf(data, size == 0 ? 2 : size * 2);
+			data[size++] = o;
+			return true;
+		}
+		else if(index != size - 1) {
+			o = data[index];
+			System.arraycopy(data, index+1, data, index, size - index - 1);
+			data[size-1] = o;
+		}
+		return false;
+	}
+
+	@Override
+	public boolean moveToFirst(KEY_TYPE o) {
+		int index = findIndex(o);
+		if(index > 0) {
+			o = data[index];
+			System.arraycopy(data, 0, data, 1, index);
+			data[0] = o;
+			return true;
+		}
+		return false;
+	}
+
+	@Override
+	public boolean moveToLast(KEY_TYPE o) {
+		int index = findIndex(o);
+		if(index != -1 && index != size - 1) {
+			o = data[index];
+			System.arraycopy(data, index+1, data, index, size - index - 1);
+			data[size-1] = o;
+			return true;
+		}
+		return false;
+	}
+	
+#if !TYPE_OBJECT
+	@Override
+	public boolean contains(KEY_TYPE e) {
+		return findIndex(e) != -1;
+	}
+	
+#else
+	@Override
+	public boolean contains(Object e) {
+		return findIndex(e) != -1;
+	}
+	
+#endif
+	@Override
+	public KEY_TYPE GET_FIRST_KEY() {
+		if(size == 0) throw new NoSuchElementException();
+		return data[0];
+	}
+	
+	@Override
+	public KEY_TYPE GET_LAST_KEY() {
+		if(size == 0) throw new NoSuchElementException();
+		return data[size - 1];
+	}
+	
+	@Override
+	public boolean removeAll(COLLECTION KEY_GENERIC_TYPE c) {
+		int j = 0;
+		for(int i = 0;i c) {
+		int j = 0;
+		for(int i = 0;i c) {
+		int j = 0;
+		for(int i = 0;i void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) {
+		Objects.requireNonNull(action);
+		for(int i = 0;i void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		for(int i = 0;i KEY_SPECIAL_TYPE reduce(KEY_SPECIAL_TYPE identity, BiFunction operator) {
+		Objects.requireNonNull(operator);
+		KEY_SPECIAL_TYPE state = identity;
+		for(int i = 0;i=0;i--)
+			if(KEY_EQUALS(data[i], o)) return i;
+		return -1;
+	}
+	
+#endif
+	protected int findIndex(Object o) {
+		for(int i = size-1;i>=0;i--)
+			if(EQUALS_KEY_TYPE(data[i], o)) return i;
+		return -1;
+	}
+	
+	@Override
+	public BI_ITERATOR KEY_GENERIC_TYPE iterator() {
+		return new SetIterator(true, 0);
+	}
+	
+	@Override
+	public BI_ITERATOR KEY_GENERIC_TYPE reverseIterator() {
+		return new SetIterator(false, size);
+	}
+	
+	@Override
+	public BI_ITERATOR KEY_GENERIC_TYPE iterator(KEY_TYPE fromElement) {
+		int index = findIndex(fromElement);
+		if(index != -1) return new SetIterator(true, index);
+		throw new NoSuchElementException();
+	}
+	
+	public ARRAY_SET KEY_GENERIC_TYPE copy() {
+		ARRAY_SET KEY_GENERIC_TYPE set = new ARRAY_SETBRACES();
+		set.data = Arrays.copyOf(data, data.length);
+		set.size = size;
+		return set;
+	}
+	
+	@Override
+	public void clear() {
+		size = 0;
+	}
+	
+	@Override
+	public int size() {
+		return size;
+	}
+	
+#if !TYPE_OBJECT
+	@Override
+	public KEY_TYPE[] TO_ARRAY(KEY_TYPE[] a) {
+		if(a == null || a.length < size()) return Arrays.copyOf(data, size());
+		System.arraycopy(data, 0, a, 0, size());
+		if (a.length > size) a[size] = EMPTY_KEY_VALUE;
+		return a;
+	}
+	
+#endif
+	@Override
+	@Deprecated
+	public Object[] toArray() {
+		if(isEmpty()) return ObjectArrays.EMPTY_ARRAY;
+		Object[] obj = new Object[size()];
+		for(int i = 0;i E[] toArray(E[] a) {
+		if(a == null) a = (E[])new Object[size()];
+		else if(a.length < size()) a = (E[])ObjectArrays.newArray(a.getClass().getComponentType(), size());
+		for(int i = 0;i size) a[size] = null;
+		return a;
+	}
+		
+	private class SetIterator implements LIST_ITERATOR KEY_GENERIC_TYPE {
+		boolean forward;
+		int index;
+		int lastReturned = -1;
+		
+		public SetIterator(boolean forward, int index) {
+			this.forward = forward;
+			this.index = index;
+		}
+		
+		@Override
+		public boolean hasNext() {
+			return forward ? index < size() : index > 0;
+		}
+		
+		@Override
+		public KEY_TYPE NEXT() {
+			if(!hasNext()) throw new NoSuchElementException();
+			if(forward) {
+				lastReturned = index;
+				return data[index++];				
+			}
+			index--;
+			return data[(lastReturned = index)];
+		}
+		
+		@Override
+		public boolean hasPrevious() {
+			return forward ? index > 0 : index < size();
+		}
+		
+		@Override
+		public KEY_TYPE PREVIOUS() {
+			if(!hasPrevious()) throw new NoSuchElementException();
+			if(forward) {
+				index--;
+				return data[(lastReturned = index)];
+			}
+			lastReturned = index;
+			return data[index++];
+		}
+		
+		@Override
+		public int nextIndex() {
+			if(forward) return index;
+			return size - index;
+		}
+		
+		@Override
+		public int previousIndex() {
+			if(forward) return index-1;
+			return (size - index)-1;
+		}
+		
+		@Override
+		public void remove() {
+			if(lastReturned == -1) throw new IllegalStateException();
+			ARRAY_SET.this.remove(data[lastReturned]);
+			if(lastReturned < index) index--;
+			lastReturned = -1;
+		}
+		
+#if TYPE_OBJECT
+		@Override
+		public void set(Object e) { throw new UnsupportedOperationException(); }
+		
+		@Override
+		public void add(Object e) { throw new UnsupportedOperationException(); }
+		
+#else
+		@Override
+		public void set(KEY_TYPE e) { throw new UnsupportedOperationException(); }
+
+		@Override
+		public void add(KEY_TYPE e) { throw new UnsupportedOperationException(); }
+		
+#endif
+		@Override
+		public int skip(int amount) {
+			if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed");
+			return forward ? moveForward(amount) : moveBackwards(amount);
+		}
+		
+		@Override
+		public int back(int amount) {
+			if(amount < 0) throw new IllegalStateException("Negative Numbers are not allowed");
+			return forward ? moveBackwards(amount) : moveForward(amount);
+		}
+		
+		private int moveForward(int amount) {
+			int steps = Math.min(amount, size() - index);
+			index += steps;
+			if(steps > 0) lastReturned = Math.min(index-1, size()-1);
+			return steps;
+		}
+		
+		private int moveBackwards(int amount) {
+			int steps = Math.min(amount, index);
+			index -= steps;
+			if(steps > 0) lastReturned = Math.min(index, size()-1);
+			return steps;
+		}
+	}
+}
diff --git a/src/builder/resources/speiger/assets/collections/templates/sets/ImmutableOpenHashSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/ImmutableOpenHashSet.template
index ba70686..c97beea 100644
--- a/src/builder/resources/speiger/assets/collections/templates/sets/ImmutableOpenHashSet.template
+++ b/src/builder/resources/speiger/assets/collections/templates/sets/ImmutableOpenHashSet.template
@@ -27,6 +27,9 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 #endif
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_FUNCTION
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
@@ -363,6 +366,16 @@ public class IMMUTABLE_HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERI
 		}
 	}
 	
+	@Override
+	public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		int index = firstIndex;
+		while(index != -1) {
+			action.accept(keys[index], input);
+			index = (int)links[index];
+		}
+	}
+	
 	@Override
 	public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 		Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/sets/LinkedOpenCustomHashSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/LinkedOpenCustomHashSet.template
index 4f1bbc0..131b16e 100644
--- a/src/builder/resources/speiger/assets/collections/templates/sets/LinkedOpenCustomHashSet.template
+++ b/src/builder/resources/speiger/assets/collections/templates/sets/LinkedOpenCustomHashSet.template
@@ -37,6 +37,9 @@ import speiger.src.collections.PACKAGE.functions.CONSUMER;
 #endif
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_FUNCTION
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
@@ -683,6 +686,16 @@ public class LINKED_CUSTOM_HASH_SET KEY_GENERIC_TYPE extends CUSTOM_HASH_SET KEY
 		}
 	}
 	
+	@Override
+	public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		int index = firstIndex;
+		while(index != -1) {
+			action.accept(keys[index], input);
+			index = (int)links[index];
+		}
+	}
+	
 	@Override
 	public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 		Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/sets/LinkedOpenHashSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/LinkedOpenHashSet.template
index c63bec4..26b9ef2 100644
--- a/src/builder/resources/speiger/assets/collections/templates/sets/LinkedOpenHashSet.template
+++ b/src/builder/resources/speiger/assets/collections/templates/sets/LinkedOpenHashSet.template
@@ -35,6 +35,9 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 #endif
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_FUNCTION
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
@@ -538,6 +541,16 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
 		}
 	}
 	
+	@Override
+	public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		int index = firstIndex;
+		while(index != -1) {
+			action.accept(keys[index], input);
+			index = (int)links[index];
+		}
+	}
+	
 	@Override
 	public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 		Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/sets/OpenCustomHashSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/OpenCustomHashSet.template
index 95c7656..e9fac0a 100644
--- a/src/builder/resources/speiger/assets/collections/templates/sets/OpenCustomHashSet.template
+++ b/src/builder/resources/speiger/assets/collections/templates/sets/OpenCustomHashSet.template
@@ -34,6 +34,9 @@ import speiger.src.collections.PACKAGE.functions.CONSUMER;
 #endif
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_FUNCTION
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
@@ -622,6 +625,16 @@ public class CUSTOM_HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_T
 		}
 	}
 	
+	@Override
+	public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		if(size() <= 0) return;
+		if(containsNull) action.accept(keys[nullIndex], input);
+		for(int i = nullIndex-1;i>=0;i--) {
+			if(!strategy.equals(keys[i], EMPTY_KEY_VALUE)) action.accept(keys[i], input);
+		}
+	}
+	
 	@Override
 	public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 		Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/sets/OpenHashSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/OpenHashSet.template
index e83b1cc..c6f931c 100644
--- a/src/builder/resources/speiger/assets/collections/templates/sets/OpenHashSet.template
+++ b/src/builder/resources/speiger/assets/collections/templates/sets/OpenHashSet.template
@@ -34,6 +34,9 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 #endif
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_FUNCTION
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
@@ -485,6 +488,16 @@ public class HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE imp
 		}
 	}
 	
+	@Override
+	public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		if(size() <= 0) return;
+		if(containsNull) action.accept(keys[nullIndex], input);
+		for(int i = nullIndex-1;i>=0;i--) {
+			if(KEY_EQUALS_NOT_NULL(keys[i])) action.accept(keys[i], input);
+		}
+	}
+	
 	@Override
 	public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 		Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/sets/RBTreeSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/RBTreeSet.template
index e5651da..601cb1b 100644
--- a/src/builder/resources/speiger/assets/collections/templates/sets/RBTreeSet.template
+++ b/src/builder/resources/speiger/assets/collections/templates/sets/RBTreeSet.template
@@ -33,6 +33,9 @@ import speiger.src.collections.PACKAGE.functions.OPTIONAL;
 #endif
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !JDK_FUNCTION
 import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 #endif
@@ -424,6 +427,13 @@ public class RB_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
 			action.accept(input, entry.key);		
 	}
 	
+	@Override
+	public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+		Objects.requireNonNull(action);
+		for(Entry KEY_GENERIC_TYPE entry = first;entry != null;entry = entry.next())
+			action.accept(entry.key, input);		
+	}
+	
 	@Override
 	public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 		Objects.requireNonNull(filter);
@@ -1371,6 +1381,13 @@ public class RB_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
 				action.accept(input, entry.key);		
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(Entry KEY_GENERIC_TYPE entry = start();entry != null && inRange(entry.key);entry = next(entry))
+				action.accept(entry.key, input);		
+		}
+		
 		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) {
 			Objects.requireNonNull(filter);
diff --git a/src/builder/resources/speiger/assets/collections/templates/utils/Collections.template b/src/builder/resources/speiger/assets/collections/templates/utils/Collections.template
index 0c114b7..94f936f 100644
--- a/src/builder/resources/speiger/assets/collections/templates/utils/Collections.template
+++ b/src/builder/resources/speiger/assets/collections/templates/utils/Collections.template
@@ -46,6 +46,9 @@ import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
 import speiger.src.collections.PACKAGE.functions.function.UNARY_OPERATOR;
 import speiger.src.collections.ints.functions.consumer.BI_FROM_INT_CONSUMER;
 import speiger.src.collections.objects.functions.consumer.BI_FROM_OBJECT_CONSUMER;
+#if !TYPE_OBJECT
+import speiger.src.collections.PACKAGE.functions.consumer.BI_TO_OBJECT_CONSUMER;
+#endif
 #if !TYPE_BOOLEAN
 import speiger.src.collections.utils.HashUtil;
 #endif
@@ -150,6 +153,9 @@ public class COLLECTIONS
 	/**
 	 * Internal Use mainly. Its a collection wrapper with 0 dependencies for those actions where a collector is needed.
 	 */
+#if !TYPE_OBJECT
+	@SuppressWarnings("exports")
+#endif
 	public static GENERIC_KEY_BRACES CollectionWrapper KEY_GENERIC_TYPE wrapper() {
 		return new CollectionWrapperBRACES();
 	}
@@ -294,6 +300,13 @@ public class COLLECTIONS
 				action.accept(elements[i]);
 		}
 		
+		@Override
+		public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) {
+			Objects.requireNonNull(action);
+			for(int i = 0;i void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) {
 			Objects.requireNonNull(action);
@@ -301,6 +314,13 @@ public class COLLECTIONS
 				action.accept(input, elements[i]);		
 		}
 		
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) {
+			Objects.requireNonNull(action);
+			for(int i = 0;i size() || size() == elements.length) return false;
@@ -855,6 +875,10 @@ public class COLLECTIONS
 		@Override
 		public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) { synchronized(mutex) { c.forEachIndexed(action); } }
 		@Override
+		public  void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) { synchronized(mutex) { c.forEach(input, action); } }
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) { synchronized(mutex) { c.forEach(action, input); } }
+		@Override
 		public int hashCode() { synchronized(mutex) { return c.hashCode(); } }
 		@Override
 		public boolean equals(Object obj) {
@@ -864,8 +888,6 @@ public class COLLECTIONS
 		@Override
 		public String toString() { synchronized(mutex) { return c.toString(); } }
 		@Override
-		public  void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) { synchronized(mutex) { c.forEach(input, action); } }
-		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) { synchronized(mutex) { return c.matchesAny(filter); } }
 		@Override
 		public boolean matchesNone(PREDICATE KEY_GENERIC_TYPE filter) { synchronized(mutex) { return c.matchesNone(filter); } }
@@ -1010,14 +1032,16 @@ public class COLLECTIONS
 		@Override
 		public void forEachIndexed(BI_FROM_INT_CONSUMER KEY_GENERIC_TYPE action) { c.forEachIndexed(action); }
 		@Override
+		public  void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) { c.forEach(input, action); }
+		@Override
+		public  void forEach(BI_TO_OBJECT_CONSUMER KKS_GENERIC_TYPE action, E input) { c.forEach(action, input); }
+		@Override
 		public int hashCode() { return c.hashCode(); }
 		@Override
 		public boolean equals(Object obj) { return obj == this || c.equals(obj); }
 		@Override
 		public String toString() { return c.toString(); }
 		@Override
-		public  void forEach(E input, BI_FROM_OBJECT_CONSUMER KSK_GENERIC_TYPE action) { c.forEach(input, action); }
-		@Override
 		public boolean matchesAny(PREDICATE KEY_GENERIC_TYPE filter) { return c.matchesAny(filter); }
 		@Override
 		public boolean matchesNone(PREDICATE KEY_GENERIC_TYPE filter) { return c.matchesNone(filter); }
diff --git a/src/builder/resources/speiger/assets/testers/templates/tests/collection/CollectionForEachTester.template b/src/builder/resources/speiger/assets/testers/templates/tests/collection/CollectionForEachTester.template
index d011ef1..38777c6 100644
--- a/src/builder/resources/speiger/assets/testers/templates/tests/collection/CollectionForEachTester.template
+++ b/src/builder/resources/speiger/assets/testers/templates/tests/collection/CollectionForEachTester.template
@@ -44,6 +44,15 @@ public class FILE_KEY_TYPECollectionForEachTester KEY_GENERIC_TYPE extends ABSTR
 		HELPERS.assertContentsAnyOrder(elements, createSamplesArray());
 	}
 	
+#ignore
+	@CollectionFeature.Require(absent = KNOWN_ORDER)
+	public void testForEachExtraUnknownOrder() {
+#endignore
+		LIST KEY_GENERIC_TYPE elements = new ARRAY_LISTBRACES();
+		collection.forEach(elements, (K, V) -> V.add(K));
+		HELPERS.assertContentsAnyOrder(elements, createSamplesArray());
+	}
+	
 #ignore
 	@CollectionFeature.Require(KNOWN_ORDER)
 	public void testForEachKnownOrder() {
@@ -70,4 +79,13 @@ public class FILE_KEY_TYPECollectionForEachTester KEY_GENERIC_TYPE extends ABSTR
 		collection.forEach(elements, LIST::add);
 		assertEquals("Different ordered iteration", HELPERS.copyToList(getOrderedElements()), elements);
 	}
+
+#ignore
+	@CollectionFeature.Require(KNOWN_ORDER)
+	public void testForEachExtraKnownOrderReverse() {
+#endignore
+		LIST KEY_GENERIC_TYPE elements = new ARRAY_LISTBRACES();
+		collection.forEach((K, V) -> V.add(K), elements);
+		assertEquals("Different ordered iteration", HELPERS.copyToList(getOrderedElements()), elements);
+	}
 }
diff --git a/src/main/java/speiger/src/collections/utils/IArray.java b/src/main/java/speiger/src/collections/utils/IArray.java
index 826e9ba..39825f4 100644
--- a/src/main/java/speiger/src/collections/utils/IArray.java
+++ b/src/main/java/speiger/src/collections/utils/IArray.java
@@ -1,20 +1,20 @@
-package speiger.src.collections.utils;
-
-import java.util.RandomAccess;
-
-/**
- * A Helper interface that allows to detect if the Underlying implementation is
- * using a Array. This allows to read methods through synchronization layers.
- * Also it implements {@link RandomAccess} and {@link ITrimmable}
- */
-public interface IArray extends RandomAccess, ITrimmable
-{
-	/**
-	 * Increases the capacity of this implementation instance, if necessary,
-	 * to ensure that it can hold at least the number of elements specified by
-	 * the minimum capacity argument.
-	 *
-	 * @param size the desired minimum capacity
-	 */
-	public void ensureCapacity(int size);
-}
+package speiger.src.collections.utils;
+
+import java.util.RandomAccess;
+
+/**
+ * A Helper interface that allows to detect if the Underlying implementation is
+ * using a Array. This allows to read methods through synchronization layers.
+ * Also it implements {@link RandomAccess} and {@link ITrimmable}
+ */
+public interface IArray extends RandomAccess, ITrimmable
+{
+	/**
+	 * Increases the capacity of this implementation instance, if necessary,
+	 * to ensure that it can hold at least the number of elements specified by
+	 * the minimum capacity argument.
+	 *
+	 * @param size the desired minimum capacity
+	 */
+	public void ensureCapacity(int size);
+}
diff --git a/src/main/java/speiger/src/collections/utils/SanityChecks.java b/src/main/java/speiger/src/collections/utils/SanityChecks.java
index b19d487..3928cea 100644
--- a/src/main/java/speiger/src/collections/utils/SanityChecks.java
+++ b/src/main/java/speiger/src/collections/utils/SanityChecks.java
@@ -1,178 +1,178 @@
-package speiger.src.collections.utils;
-
-import java.util.Random;
-import java.util.concurrent.ForkJoinPool;
-import java.util.concurrent.ForkJoinTask;
-
-/**
- * Helper class that provides functions that are shared within the library.
- * On top of that it provides some helper functions that allow control of some internals of the Library
- */
-public class SanityChecks
-{
-	/** Max Possible ArraySize without the JVM Crashing */
-	public static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
-	private static ForkJoinPool WORK_POOL = ForkJoinPool.commonPool();
-	private static boolean FORCE_IGNORE_PARALLELISM = false;
-	private static ThreadLocal RANDOM = ThreadLocal.withInitial(Random::new);
-	private static ThreadLocal FORCE_ASYNC = ThreadLocal.withInitial(() -> false);
-	private static ThreadLocal FORCE_TASK_POOL = ThreadLocal.withInitial(() -> false);
-	
-	/**
-	 * Internal function to cast a Integer to a Byte
-	 * @param value that should be turned into a byte
-	 * @return the value as a byte
-	 * @throws IllegalStateException if the value does not fit within a byte
-	 */
-	public static byte castToByte(int value) {
-		if(value > Byte.MAX_VALUE || value < Byte.MIN_VALUE) throw new IllegalStateException("Value ["+value+"] out of Byte[-128,127] range");
-		return (byte)value;
-	}
-	
-	/**
-	 * Internal function to cast a Integer to a Short
-	 * @param value that should be turned into a short
-	 * @return the value as a short
-	 * @throws IllegalStateException if the value does not fit within a short
-	 */	
-	public static short castToShort(int value) {
-		if(value > Short.MAX_VALUE || value < Short.MIN_VALUE) throw new IllegalStateException("Value ["+value+"] out of Short[-32768,32767] range");
-		return (short)value;
-	}
-	
-	/**
-	 * Internal function to cast a Integer to a Character
-	 * @param value that should be turned into a char
-	 * @return the value as a char
-	 * @throws IllegalStateException if the value does not fit within a char
-	 */
-	public static char castToChar(int value) {
-		if(value > Character.MAX_VALUE || value < Character.MIN_VALUE) throw new IllegalStateException("Value ["+value+"] out of Character[0,65535] range");
-		return (char)value;
-	}
-	
-	/**
-	 * Internal function to cast a Double to a Double
-	 * @param value that should be turned into a float
-	 * @return the value as a float
-	 * @throws IllegalStateException if the value does not fit within a float
-	 */
-	public static float castToFloat(double value) {
-		if(Double.isNaN(value)) return Float.NaN;
-		if(Double.isInfinite(value)) return value > 0 ? Float.POSITIVE_INFINITY : Float.NEGATIVE_INFINITY;
-		if(value < -Float.MAX_VALUE || value > Float.MAX_VALUE) throw new IllegalStateException("Value ["+value+"] out of Float range");
-		return (float)value;
-	}
-	
-	/**
-	 * Internal function that checks if the given array-size is big enough for the access.
-	 * @param arraySize the size of the Array
-	 * @param offset the offset of the access
-	 * @param accessSize the length of the access
-	 * @throws IllegalStateException if offset or accessSize is negative or the range goes out of the array-size
-	 */
-	public static void checkArrayCapacity(int arraySize, int offset, int accessSize) {
-		if(offset < 0) throw new IndexOutOfBoundsException("Offset is negative ("+offset+")");
-		else if(accessSize < 0) throw new IllegalArgumentException("Size is negative ("+accessSize+")");
-		else if(arraySize < offset + accessSize) throw new IndexOutOfBoundsException("Index (" + (offset + accessSize) + ") is not in size (" + arraySize + ")");
-	}
-	
-	/**
-	 * Returns if the current thread-pool can handle Multi-threading tasks
-	 * @return true if the thread-count is bigger the 1
-	 */
-	public static boolean canParallelTask() {
-		return getPool().getParallelism() > 1 || FORCE_IGNORE_PARALLELISM;
-	}
-	
-	/**
-	 * Helper method to start a ForkJoinTask. This method will await the finalization of said task
-	 * @param task the Task to invoke
-	 * @param  the type of the task
-	 */
-	public static  void invokeTask(ForkJoinTask task) {
-		if(FORCE_ASYNC.get().booleanValue()) invokeAsyncTask(task);
-		else getPool().invoke(task);
-	}
-	
-	/**
-	 * Helper method to start a ForkJoinTask. This method will not await the finalization of said task
-	 * @param task the Task to invoke
-	 * @param  the type of the task
-	 */
-	public static  void invokeAsyncTask(ForkJoinTask task) {
-		getPool().execute(task);
-	}
-	
-	/**
-	 * A Helper method to start a Async Task. This method will not await the finalization of said task
-	 * @param task the Task to invoke
-	 */
-	public static void invokeAsyncTask(Runnable task) {
-		getPool().execute(task);
-	}
-	
-	/**
-	 * Helper method to control what ForkJoinPool is being used for any given task.
-	 * @note this method is not thread-save. It is only there to provide control over how Library specific Threaded tasks are handled.
-	 * @param pool The ForkJoinPool that should receive the tasks. If null {@link ForkJoinPool#commonPool()} is set instead
-	 */
-	public static void setWorkPool(ForkJoinPool pool) {
-		WORK_POOL = pool == null ? ForkJoinPool.commonPool() : pool;
-	}
-	
-	private static ForkJoinPool getPool() {
-		if(FORCE_TASK_POOL.get().booleanValue()) {
-			ForkJoinPool pool = ForkJoinTask.getPool();
-			if(pool != null) return pool;
-		}
-		return WORK_POOL;
-	}
-	
-	/**
-	 * Helper method to detect if the Current Thread forces not to await task completion.
-	 * @return if the Current Thread has not to await task completion.
-	 */
-	public static boolean isForcedAsync() {
-		return FORCE_ASYNC.get().booleanValue();
-	}
-	
-	/**
-	 * Helper method to detect if the current thread forces to execute tasks in the current Thread-pool if it is a ForkJoinPool.
-	 * @return if the task checks the current pool to be executed in if it is valid.
-	 */
-	public static boolean isForcedTaskPool() {
-		return FORCE_TASK_POOL.get().booleanValue();
-	}
-	
-	/**
-	 * Helper method to decide if the current thread should forcefully not wait on tasks to be completed.
-	 * @param value it tasks should not be awaited for
-	 */
-	public static void setForcedAsync(boolean value) {
-		FORCE_ASYNC.set(Boolean.valueOf(value));
-	}
-	
-	/**
-	 * Helper method to decide if it should be checked for if the current thread is a ThreadPool Worker (ForkJoinPool Worker to be specific) and if tasks should be delegated into it.
-	 * @param value if the current thread should check if it is a ThreadPoolWorker.
-	 */
-	public static void setForcedTaskPool(boolean value) {
-		FORCE_TASK_POOL.set(Boolean.valueOf(value));
-	}
-	
-	/**
-	 * Helper method to decide if Parallelism should be checked or not.
-	 * @param value if the Parallelism should be ignored
-	 */
-	public static void setForceIgnoreParallelism(boolean value) {
-		FORCE_IGNORE_PARALLELISM = value;
-	}
-	
-	/**
-	 * @return Thread Specific Random needed for internal functions in this library.
-	 */
-	public static Random getRandom() {
-		return RANDOM.get();
-	}
-}
+package speiger.src.collections.utils;
+
+import java.util.Random;
+import java.util.concurrent.ForkJoinPool;
+import java.util.concurrent.ForkJoinTask;
+
+/**
+ * Helper class that provides functions that are shared within the library.
+ * On top of that it provides some helper functions that allow control of some internals of the Library
+ */
+public class SanityChecks
+{
+	/** Max Possible ArraySize without the JVM Crashing */
+	public static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
+	private static ForkJoinPool WORK_POOL = ForkJoinPool.commonPool();
+	private static boolean FORCE_IGNORE_PARALLELISM = false;
+	private static ThreadLocal RANDOM = ThreadLocal.withInitial(Random::new);
+	private static ThreadLocal FORCE_ASYNC = ThreadLocal.withInitial(() -> false);
+	private static ThreadLocal FORCE_TASK_POOL = ThreadLocal.withInitial(() -> false);
+	
+	/**
+	 * Internal function to cast a Integer to a Byte
+	 * @param value that should be turned into a byte
+	 * @return the value as a byte
+	 * @throws IllegalStateException if the value does not fit within a byte
+	 */
+	public static byte castToByte(int value) {
+		if(value > Byte.MAX_VALUE || value < Byte.MIN_VALUE) throw new IllegalStateException("Value ["+value+"] out of Byte[-128,127] range");
+		return (byte)value;
+	}
+	
+	/**
+	 * Internal function to cast a Integer to a Short
+	 * @param value that should be turned into a short
+	 * @return the value as a short
+	 * @throws IllegalStateException if the value does not fit within a short
+	 */	
+	public static short castToShort(int value) {
+		if(value > Short.MAX_VALUE || value < Short.MIN_VALUE) throw new IllegalStateException("Value ["+value+"] out of Short[-32768,32767] range");
+		return (short)value;
+	}
+	
+	/**
+	 * Internal function to cast a Integer to a Character
+	 * @param value that should be turned into a char
+	 * @return the value as a char
+	 * @throws IllegalStateException if the value does not fit within a char
+	 */
+	public static char castToChar(int value) {
+		if(value > Character.MAX_VALUE || value < Character.MIN_VALUE) throw new IllegalStateException("Value ["+value+"] out of Character[0,65535] range");
+		return (char)value;
+	}
+	
+	/**
+	 * Internal function to cast a Double to a Double
+	 * @param value that should be turned into a float
+	 * @return the value as a float
+	 * @throws IllegalStateException if the value does not fit within a float
+	 */
+	public static float castToFloat(double value) {
+		if(Double.isNaN(value)) return Float.NaN;
+		if(Double.isInfinite(value)) return value > 0 ? Float.POSITIVE_INFINITY : Float.NEGATIVE_INFINITY;
+		if(value < -Float.MAX_VALUE || value > Float.MAX_VALUE) throw new IllegalStateException("Value ["+value+"] out of Float range");
+		return (float)value;
+	}
+	
+	/**
+	 * Internal function that checks if the given array-size is big enough for the access.
+	 * @param arraySize the size of the Array
+	 * @param offset the offset of the access
+	 * @param accessSize the length of the access
+	 * @throws IllegalStateException if offset or accessSize is negative or the range goes out of the array-size
+	 */
+	public static void checkArrayCapacity(int arraySize, int offset, int accessSize) {
+		if(offset < 0) throw new IndexOutOfBoundsException("Offset is negative ("+offset+")");
+		else if(accessSize < 0) throw new IllegalArgumentException("Size is negative ("+accessSize+")");
+		else if(arraySize < offset + accessSize) throw new IndexOutOfBoundsException("Index (" + (offset + accessSize) + ") is not in size (" + arraySize + ")");
+	}
+	
+	/**
+	 * Returns if the current thread-pool can handle Multi-threading tasks
+	 * @return true if the thread-count is bigger the 1
+	 */
+	public static boolean canParallelTask() {
+		return getPool().getParallelism() > 1 || FORCE_IGNORE_PARALLELISM;
+	}
+	
+	/**
+	 * Helper method to start a ForkJoinTask. This method will await the finalization of said task
+	 * @param task the Task to invoke
+	 * @param  the type of the task
+	 */
+	public static  void invokeTask(ForkJoinTask task) {
+		if(FORCE_ASYNC.get().booleanValue()) invokeAsyncTask(task);
+		else getPool().invoke(task);
+	}
+	
+	/**
+	 * Helper method to start a ForkJoinTask. This method will not await the finalization of said task
+	 * @param task the Task to invoke
+	 * @param  the type of the task
+	 */
+	public static  void invokeAsyncTask(ForkJoinTask task) {
+		getPool().execute(task);
+	}
+	
+	/**
+	 * A Helper method to start a Async Task. This method will not await the finalization of said task
+	 * @param task the Task to invoke
+	 */
+	public static void invokeAsyncTask(Runnable task) {
+		getPool().execute(task);
+	}
+	
+	/**
+	 * Helper method to control what ForkJoinPool is being used for any given task.
+	 * @note this method is not thread-save. It is only there to provide control over how Library specific Threaded tasks are handled.
+	 * @param pool The ForkJoinPool that should receive the tasks. If null {@link ForkJoinPool#commonPool()} is set instead
+	 */
+	public static void setWorkPool(ForkJoinPool pool) {
+		WORK_POOL = pool == null ? ForkJoinPool.commonPool() : pool;
+	}
+	
+	private static ForkJoinPool getPool() {
+		if(FORCE_TASK_POOL.get().booleanValue()) {
+			ForkJoinPool pool = ForkJoinTask.getPool();
+			if(pool != null) return pool;
+		}
+		return WORK_POOL;
+	}
+	
+	/**
+	 * Helper method to detect if the Current Thread forces not to await task completion.
+	 * @return if the Current Thread has not to await task completion.
+	 */
+	public static boolean isForcedAsync() {
+		return FORCE_ASYNC.get().booleanValue();
+	}
+	
+	/**
+	 * Helper method to detect if the current thread forces to execute tasks in the current Thread-pool if it is a ForkJoinPool.
+	 * @return if the task checks the current pool to be executed in if it is valid.
+	 */
+	public static boolean isForcedTaskPool() {
+		return FORCE_TASK_POOL.get().booleanValue();
+	}
+	
+	/**
+	 * Helper method to decide if the current thread should forcefully not wait on tasks to be completed.
+	 * @param value it tasks should not be awaited for
+	 */
+	public static void setForcedAsync(boolean value) {
+		FORCE_ASYNC.set(Boolean.valueOf(value));
+	}
+	
+	/**
+	 * Helper method to decide if it should be checked for if the current thread is a ThreadPool Worker (ForkJoinPool Worker to be specific) and if tasks should be delegated into it.
+	 * @param value if the current thread should check if it is a ThreadPoolWorker.
+	 */
+	public static void setForcedTaskPool(boolean value) {
+		FORCE_TASK_POOL.set(Boolean.valueOf(value));
+	}
+	
+	/**
+	 * Helper method to decide if Parallelism should be checked or not.
+	 * @param value if the Parallelism should be ignored
+	 */
+	public static void setForceIgnoreParallelism(boolean value) {
+		FORCE_IGNORE_PARALLELISM = value;
+	}
+	
+	/**
+	 * @return Thread Specific Random needed for internal functions in this library.
+	 */
+	public static Random getRandom() {
+		return RANDOM.get();
+	}
+}