this.world4 = this.modelFactory.newWorldBuilder().id(2000).name("abc").worldLocation(WorldLocationType.NORTH_AMERICA).build();
}
@Test
public void testNewWorldEntityAndFindWorldEntityById() {
final WorldEntityDAO dao = new WorldEntityDAO();
assertTrue(dao.retrieveAllWorldEntities().size() == 0);
assertFalse(dao.findWorldEntityById(1).isPresent());
assertFalse(dao.findWorldEntityById(2).isPresent());
assertFalse(dao.findWorldEntityById(3).isPresent());
assertTrue(dao.newWorldEntityOf(this.world1).isPresent());
assertTrue(dao.retrieveAllWorldEntities().size() == 1);
assertTrue(dao.findWorldEntityById(1).isPresent());
assertFalse(dao.newWorldEntityOf(this.world1).isPresent());
assertTrue(dao.findWorldEntityById(1).isPresent());
assertTrue(dao.retrieveAllWorldEntities().size() == 1);
assertTrue(dao.newWorldEntityOf(this.world2).isPresent());
assertTrue(dao.retrieveAllWorldEntities().size() == 2);
assertTrue(dao.findWorldEntityById(3).isPresent());
assertFalse(dao.newWorldEntityOf(this.world2).isPresent());
assertTrue(dao.findWorldEntityById(3).isPresent());
assertTrue(dao.retrieveAllWorldEntities().size() == 2);
assertTrue(dao.newWorldEntityOf(this.world3).isPresent());
assertTrue(dao.findWorldEntityById(5).isPresent());
assertFalse(dao.newWorldEntityOf(this.world3).isPresent());
assertTrue(dao.findWorldEntityById(5).isPresent());
}