Assert.assertEquals(new Long(8), emp.getId());
}
@Test
public void saveComplicatedTest() throws UserAlreadyExist {
Employee emp = createEmployee(null, 1);
emp = dao.save(emp);
Assert.assertEquals(new Long(6), emp.getId());
EntityStorage.getEntities().remove(1L);
emp = createEmployee(null, 1);
emp = dao.save(emp);
Assert.assertEquals(new Long(7), emp.getId());
EntityStorage.getEntities().remove(2L);
EntityStorage.getEntities().remove(3L);
emp = createEmployee(null, 1);
emp = dao.save(emp);
Assert.assertEquals(new Long(8), emp.getId());
EntityStorage.getEntities().remove(7L);
EntityStorage.getEntities().remove(8L);
emp = createEmployee(null, 1);
emp = dao.save(emp);
Assert.assertEquals(new Long(7), emp.getId());
}