### Question:
ClusterUtils { public static long getRemainingCooldownTime(long coolDownMs, long lastScalingActivity) { return lastScalingActivity == 0L ? 0L : coolDownMs - (System.currentTimeMillis() - lastScalingActivity); } private  ClusterUtils(); static long getRemainingCooldownTime(long coolDownMs, long lastScalingActivity); static long memoryBytesToMB(long memoryInBytes); static final DecimalFormat TIME_FORMAT; static final int MAX_CAPACITY; static final long MEGABYTE; }### Answer:
@Test public void testGetRemainingCoolDownWhenNoScalingDone() { long remainingTime = ClusterUtils.getRemainingCooldownTime(30 * TimeUtil.MIN_IN_MS, 0); assertEquals("Remaining Time should be 0 when no scaling", 0, remainingTime); }
@Test public void testGetRemainingCoolDownAfterCoolDownTimeThenGreaterThanZero() { long remainingTime = ClusterUtils.getRemainingCooldownTime(30 * TimeUtil.MIN_IN_MS, Instant.now().minus(35, ChronoUnit.MINUTES).toEpochMilli()); assertTrue("Remaining Time should be negative when cool down period elapsed.", remainingTime <= 0); }
@Test public void testGetRemainingCoolDownBeforeCoolDownTimeThenLesserThanZero() { long remainingTime = ClusterUtils.getRemainingCooldownTime(30 * TimeUtil.MIN_IN_MS, Instant.now().minus(20, ChronoUnit.MINUTES).toEpochMilli()); assertTrue("Remaining Time should be positive when cool down period not elapsed.", remainingTime > 0); }