### Question:
EventGenerationIdsChecker { public boolean isInSync(UserSyncStatus userSyncStatus, UmsEventGenerationIds currentGeneration) { Stack stack = userSyncStatus.getStack(); boolean inSync = userSyncStatus != null && userSyncStatus.getUmsEventGenerationIds() != null; if (inSync) { try { UmsEventGenerationIds lastUmsEventGenerationIds = userSyncStatus.getUmsEventGenerationIds().get(UmsEventGenerationIds.class); inSync = currentGeneration.equals(lastUmsEventGenerationIds); } catch (IOException e) { LOGGER.warn("Failed to retrieve UmsEventGenerationIds for Environment {} in Account {}. Assuming not in sync", stack.getEnvironmentCrn(), stack.getAccountId()); inSync = false; } } LOGGER.debug("Environment {} in Account {} {} in sync", stack.getEnvironmentCrn(), stack.getAccountId(), inSync ? "is" : "is not"); return inSync; }  boolean isInSync(UserSyncStatus userSyncStatus, UmsEventGenerationIds currentGeneration);  }### Answer:
@Test void testIsNotInSync() { Stack stack = UserSyncTestUtils.createStack(); UmsEventGenerationIds currentEventGenerationIds = UserSyncTestUtils.createUniqueUmsEventGenerationIds(); UserSyncStatus userSyncStatus = UserSyncTestUtils.createUserSyncStatus(stack); userSyncStatus.setUmsEventGenerationIds(new Json(UserSyncTestUtils.createUniqueUmsEventGenerationIds())); assertFalse(underTest.isInSync(userSyncStatus, currentEventGenerationIds)); }
@Test void testIsInSync() { Stack stack = UserSyncTestUtils.createStack(); UmsEventGenerationIds currentEventGenerationIds = UserSyncTestUtils.createUniqueUmsEventGenerationIds(); UserSyncStatus userSyncStatus = UserSyncTestUtils.createUserSyncStatus(stack); userSyncStatus.setUmsEventGenerationIds(new Json(currentEventGenerationIds)); assertTrue(underTest.isInSync(userSyncStatus, currentEventGenerationIds)); }