// Path: src/main/java/jalse/attributes/NamedAttributeType.java
// public final class NamedAttributeType<T> {
// 
//     private final String name;
//     private final AttributeType<T> type;
// 
//     /**
//      * Creates a new named attribute type.
//      *
//      * @param name
//      *            Attribute type name.
//      * @param type
//      *            Attribute type.
//      */
//     public NamedAttributeType(final String name, final AttributeType<T> type) {
// 	this.name = requireNotEmpty(name);
// 	this.type = Objects.requireNonNull(type);
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
// 	if (obj == this) {
// 	    return true;
// 	}
// 
// 	if (!(obj instanceof NamedAttributeType<?>)) {
// 	    return false;
// 	}
// 
// 	final NamedAttributeType<?> other = (NamedAttributeType<?>) obj;
// 	return name.equals(other.name) && type.equals(other.type);
//     }
// 
//     /**
//      * Gets the attribute type name.
//      *
//      * @return Name.
//      */
//     public String getName() {
// 	return name;
//     }
// 
//     /**
//      * Gets the attribute type.
//      *
//      * @return Attribute type.
//      */
//     public AttributeType<T> getType() {
// 	return type;
//     }
// 
//     @Override
//     public int hashCode() {
// 	final int prime = 31;
// 	int result = 1;
// 	result = prime * result + name.hashCode();
// 	result = prime * result + type.hashCode();
// 	return result;
//     }
// 
//     @Override
//     public String toString() {
// 	return "NamedAttributeType [" + name + ":" + type.getValueType().getTypeName() + "]";
//     }
// }


import java.util.HashSet;
import java.util.Iterator;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import jalse.attributes.AttributeListener;
import jalse.attributes.NamedAttributeType;
import jalse.entities.EntityVisitor.EntityVisitResult;
     * @return Whether the descendant is equal or descended from the ancestor type.
     */
    public static boolean isOrSubtype(final Class<? extends Entity> descendant,
	    final Class<? extends Entity> ancestor) {
	return ancestor.isAssignableFrom(descendant);
    }

    /**
     * Checks if the specified type is a descendant from the specified ancestor type.
     *
     * @param descendant
     *            Descendant type.
     * @param ancestor
     *            Ancestor type.
     * @return Whether the descendant is descended from the ancestor type.
     */
    public static boolean isSubtype(final Class<? extends Entity> descendant, final Class<? extends Entity> ancestor) {
	return !ancestor.equals(descendant) && ancestor.isAssignableFrom(descendant);
    }

    /**
     * Creates an recursive entity listener for named attribute type and the supplied attribute
     * listener supplier with Integer.MAX_VALUE recursion limit.
     *
     * @param namedType
     *            Named attribute type being listened for by supplier's listeners.
     * @param supplier
     *            Supplier of the attribute listener to be added to created entities.
     * @return Recursive attribute listener for named type and supplier.
     */
// Path: src/main/java/jalse/attributes/NamedAttributeType.java
// public final class NamedAttributeType<T> {
// 
//     private final String name;
//     private final AttributeType<T> type;
// 
//     /**
//      * Creates a new named attribute type.
//      *
//      * @param name
//      *            Attribute type name.
//      * @param type
//      *            Attribute type.
//      */
//     public NamedAttributeType(final String name, final AttributeType<T> type) {
// 	this.name = requireNotEmpty(name);
// 	this.type = Objects.requireNonNull(type);
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
// 	if (obj == this) {
// 	    return true;
// 	}
// 
// 	if (!(obj instanceof NamedAttributeType<?>)) {
// 	    return false;
// 	}
// 
// 	final NamedAttributeType<?> other = (NamedAttributeType<?>) obj;
// 	return name.equals(other.name) && type.equals(other.type);
//     }
// 
//     /**
//      * Gets the attribute type name.
//      *
//      * @return Name.
//      */
//     public String getName() {
// 	return name;
//     }
// 
//     /**
//      * Gets the attribute type.
//      *
//      * @return Attribute type.
//      */
//     public AttributeType<T> getType() {
// 	return type;
//     }
// 
//     @Override
//     public int hashCode() {
// 	final int prime = 31;
// 	int result = 1;
// 	result = prime * result + name.hashCode();
// 	result = prime * result + type.hashCode();
// 	return result;
//     }
// 
//     @Override
//     public String toString() {
// 	return "NamedAttributeType [" + name + ":" + type.getValueType().getTypeName() + "]";
//     }
// }


// Path: src/main/java/jalse/entities/Entities.java
import java.util.HashSet;
import java.util.Iterator;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import jalse.attributes.AttributeListener;
import jalse.attributes.NamedAttributeType;
import jalse.entities.EntityVisitor.EntityVisitResult;

     * @return Whether the descendant is equal or descended from the ancestor type.
     */
    public static boolean isOrSubtype(final Class<? extends Entity> descendant,
	    final Class<? extends Entity> ancestor) {
	return ancestor.isAssignableFrom(descendant);
    }

    /**
     * Checks if the specified type is a descendant from the specified ancestor type.
     *
     * @param descendant
     *            Descendant type.
     * @param ancestor
     *            Ancestor type.
     * @return Whether the descendant is descended from the ancestor type.
     */
    public static boolean isSubtype(final Class<? extends Entity> descendant, final Class<? extends Entity> ancestor) {
	return !ancestor.equals(descendant) && ancestor.isAssignableFrom(descendant);
    }

    /**
     * Creates an recursive entity listener for named attribute type and the supplied attribute
     * listener supplier with Integer.MAX_VALUE recursion limit.
     *
     * @param namedType
     *            Named attribute type being listened for by supplier's listeners.
     * @param supplier
     *            Supplier of the attribute listener to be added to created entities.
     * @return Recursive attribute listener for named type and supplier.
     */
    public static <T> EntityListener newRecursiveAttributeListener(final NamedAttributeType<T> namedType,