### Question:
CooldownChecker { public boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime) { requireNonNull(userSyncStatus, "userSyncStatus is null"); boolean cool; if (userSyncStatus.getLastStartedFullSync() != null) { cool = Instant.ofEpochMilli(userSyncStatus.getLastStartedFullSync().getStartTime()).isBefore(cooldownThresholdTime); } else { cool = true; } if (LOGGER.isDebugEnabled()) { Stack stack = userSyncStatus.getStack(); LOGGER.debug("Synchronization to Environment {} in Account {} {} been run since {}", stack.getEnvironmentCrn(), stack.getAccountId(), cool ? "has not" : "has", DATE_TIME_FORMATTER.format(cooldownThresholdTime)); } return cool; }  boolean isCooldownExpired(UserSyncStatus userSyncStatus, Instant cooldownThresholdTime);  }### Answer:
@Test void testNullThrows() { assertThrows(NullPointerException.class, () -> underTest.isCooldownExpired(null, Instant.now())); }
@Test void testNoStartTimeIsCool() { Stack stack = UserSyncTestUtils.createStack(); UserSyncStatus userSyncStatus = UserSyncTestUtils.createUserSyncStatus(stack); Instant cooldownExpiration = Instant.now(); assertTrue(underTest.isCooldownExpired(userSyncStatus, cooldownExpiration)); }
@Test void testIsCool() { Stack stack = UserSyncTestUtils.createStack(); UserSyncStatus userSyncStatus = UserSyncTestUtils.createUserSyncStatus(stack); Instant cooldownExpiration = Instant.now(); long lastStartTime = cooldownExpiration.toEpochMilli() - 1L; Operation lastRequestedOperation = new Operation(); lastRequestedOperation.setStartTime(lastStartTime); userSyncStatus.setLastStartedFullSync(lastRequestedOperation); assertTrue(underTest.isCooldownExpired(userSyncStatus, cooldownExpiration)); }
@Test void testIsNotCool() { Stack stack = UserSyncTestUtils.createStack(); UserSyncStatus userSyncStatus = UserSyncTestUtils.createUserSyncStatus(stack); Instant cooldownExpiration = Instant.now(); long lastStartTime = cooldownExpiration.toEpochMilli() + 1L; Operation lastRequestedOperation = new Operation(); lastRequestedOperation.setStartTime(lastStartTime); userSyncStatus.setLastStartedFullSync(lastRequestedOperation); assertFalse(underTest.isCooldownExpired(userSyncStatus, cooldownExpiration)); }