### Question:
TimeGranularity implements Granularity<LocalTime> { @Override public boolean isCorrectScale(LocalTime value) { return trimToGranularity(value).equals(value); } TimeGranularity(ChronoUnit granularity); static TimeGranularity create(String granularity); @Override Granularity<LocalTime> getFinestGranularity(); @Override boolean isCorrectScale(LocalTime value); @Override Granularity<LocalTime> merge(Granularity<LocalTime> otherGranularity); @Override LocalTime getNext(LocalTime value, int amount); @Override LocalTime getNext(LocalTime value); @Override LocalTime getPrevious(LocalTime value, int amount); @Override LocalTime getPrevious(LocalTime value); @Override LocalTime trimToGranularity(LocalTime value); @Override LocalTime getRandom(LocalTime min, LocalTime max, RandomNumberGenerator randomNumberGenerator); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final TimeGranularity DEFAULT; }### Answer:
@Test void isCorrectScale_returnsTrue_WithCorrectScale() { TimeGranularity granularity = new TimeGranularity(ChronoUnit.MINUTES); LocalTime time = LocalTime.of(6, 13); Assert.assertTrue(granularity.isCorrectScale(time)); }
@Test void isCorrectScale_returnsFalse_WithIncorrectScale() { TimeGranularity granularity = new TimeGranularity(ChronoUnit.MINUTES); LocalTime time = LocalTime.of(1, 39, 43); Assert.assertFalse(granularity.isCorrectScale(time)); }