// Path: src/main/java/jalse/entities/Entities.java
//    public static <T extends Entity> T asType(final Entity entity, final Class<T> type) {
// return getProxyFactory().proxyOfEntity(entity, type);
//    }


import static jalse.entities.Entities.asType;
import java.util.HashSet;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Stream;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
	Assert.assertFalse(container.hasEntity(new UUID(0, 100)));

	Optional<Entity> optEntity = container.getOptEntity(new UUID(0, 100));
	Assert.assertFalse(optEntity.isPresent());
	optEntity = container.getOptEntity(new UUID(0, 0));
	Assert.assertTrue(optEntity.isPresent());
    }

    @After
    public void after() {
	container = null;
    }

    @Test
    public void entityClassTest() {
	container = new DefaultEntityContainer();

	container.newEntity();
	container.newEntity(new UUID(0, 0));
	container.newEntity(TestEntity.class);
	container.newEntity(new UUID(0, 1), TestEntity.class);

	final HashSet<DefaultEntity> entities = (HashSet<DefaultEntity>) container
		.getEntitiesOfType(DefaultEntity.class);
	for (final Entity entity : entities) {
	    Assert.assertEquals(DefaultEntity.class, entity.getClass());
	}
	final Stream<DefaultEntity> entityStream = container.streamEntitiesOfType(DefaultEntity.class);
	entityStream.forEach(e -> Assert.assertEquals(DefaultEntity.class, e.getClass()));

// Path: src/main/java/jalse/entities/Entities.java
//    public static <T extends Entity> T asType(final Entity entity, final Class<T> type) {
// return getProxyFactory().proxyOfEntity(entity, type);
//    }


// Path: src/test/java/jalse/entities/EntityContainerTest.java
import static jalse.entities.Entities.asType;
import java.util.HashSet;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Stream;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;

	Assert.assertFalse(container.hasEntity(new UUID(0, 100)));

	Optional<Entity> optEntity = container.getOptEntity(new UUID(0, 100));
	Assert.assertFalse(optEntity.isPresent());
	optEntity = container.getOptEntity(new UUID(0, 0));
	Assert.assertTrue(optEntity.isPresent());
    }

    @After
    public void after() {
	container = null;
    }

    @Test
    public void entityClassTest() {
	container = new DefaultEntityContainer();

	container.newEntity();
	container.newEntity(new UUID(0, 0));
	container.newEntity(TestEntity.class);
	container.newEntity(new UUID(0, 1), TestEntity.class);

	final HashSet<DefaultEntity> entities = (HashSet<DefaultEntity>) container
		.getEntitiesOfType(DefaultEntity.class);
	for (final Entity entity : entities) {
	    Assert.assertEquals(DefaultEntity.class, entity.getClass());
	}
	final Stream<DefaultEntity> entityStream = container.streamEntitiesOfType(DefaultEntity.class);
	entityStream.forEach(e -> Assert.assertEquals(DefaultEntity.class, e.getClass()));

	final Class<? extends TestEntity> type = asType(container.getEntity(new UUID(0, 0)), TestEntity.class)