List<Criterion> criterions = new ArrayList<Criterion>();
expect(
criterionServiceMock
.findByType(PredefinedCriterionTypes.LOCATION))
.andReturn(criterions).anyTimes();
expect(resourceDAOMock.find(workerToReturn.getId()))
.andReturn(workerToReturn);
resourceDAOMock.save(workerToReturn);
workerToReturn.checkNotOverlaps();
replay(resourceDAOMock, criterionServiceMock);
// perform actions