### Question:
WorkbasketServiceImpl implements WorkbasketService { void checkModifiedHasNotChanged(Workbasket oldWorkbasket, WorkbasketImpl workbasketImplToUpdate) throws ConcurrencyException { if (!oldWorkbasket.getModified().equals(workbasketImplToUpdate.getModified())) { throw new ConcurrencyException( "The current Workbasket has been modified while editing. " + "The values can not be updated. Workbasket " + workbasketImplToUpdate.toString()); } } WorkbasketServiceImpl(
      InternalTaskanaEngine taskanaEngine,
      WorkbasketMapper workbasketMapper,
      DistributionTargetMapper distributionTargetMapper,
      WorkbasketAccessMapper workbasketAccessMapper); @Override Workbasket getWorkbasket(String workbasketId); @Override Workbasket getWorkbasket(String workbasketKey, String domain); @Override Workbasket createWorkbasket(Workbasket newWorkbasket); @Override Workbasket updateWorkbasket(Workbasket workbasketToUpdate); @Override WorkbasketAccessItem newWorkbasketAccessItem(String workbasketId, String accessId); @Override WorkbasketAccessItem createWorkbasketAccessItem(WorkbasketAccessItem workbasketAccessItem); @Override WorkbasketAccessItem updateWorkbasketAccessItem(WorkbasketAccessItem workbasketAccessItem); @Override void deleteWorkbasketAccessItem(String accessItemId); @Override void checkAuthorization(String workbasketId, WorkbasketPermission... requestedPermissions); @Override void checkAuthorization(
      String workbasketKey, String domain, WorkbasketPermission... requestedPermissions); @Override List<WorkbasketAccessItem> getWorkbasketAccessItems(String workbasketId); @Override void setWorkbasketAccessItems(
      String workbasketId, List<WorkbasketAccessItem> wbAccessItems); @Override WorkbasketQuery createWorkbasketQuery(); @Override WorkbasketAccessItemQuery createWorkbasketAccessItemQuery(); @Override Workbasket newWorkbasket(String key, String domain); @Override List<WorkbasketPermission> getPermissionsForWorkbasket(String workbasketId); @Override List<WorkbasketSummary> getDistributionTargets(String workbasketId); @Override List<WorkbasketSummary> getDistributionTargets(String workbasketKey, String domain); @Override void setDistributionTargets(String sourceWorkbasketId, List<String> targetWorkbasketIds); @Override void addDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId); @Override void removeDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId); @Override boolean deleteWorkbasket(String workbasketId); BulkOperationResults<String, TaskanaException> deleteWorkbaskets(
      List<String> workbasketsIds); @Override List<WorkbasketSummary> getDistributionSources(String workbasketId); @Override List<WorkbasketSummary> getDistributionSources(String workbasketKey, String domain); @Override void deleteWorkbasketAccessItemsForAccessId(String accessId);  }### Answer:
@Test void testCheckModifiedHasNotChanged() { Instant expectedModifiedTimestamp = Instant.now(); WorkbasketImpl oldWb = createTestWorkbasket(null, "Key-1"); WorkbasketImpl workbasketImplToUpdate = createTestWorkbasket(null, "Key-2"); oldWb.setModified(expectedModifiedTimestamp); workbasketImplToUpdate.setModified(expectedModifiedTimestamp); ThrowingCallable call = () -> workbasketServiceSpy.checkModifiedHasNotChanged(oldWb, workbasketImplToUpdate); assertThatCode(call).doesNotThrowAnyException(); workbasketImplToUpdate.setModified(expectedModifiedTimestamp.minus(1, ChronoUnit.HOURS)); call = () -> workbasketServiceSpy.checkModifiedHasNotChanged(oldWb, workbasketImplToUpdate); assertThatThrownBy(call).isInstanceOf(ConcurrencyException.class); }