4

In the original code you call timeProvider.provide() several times resulting in (slightly) different times in a case where you should be comparing the same time each time. While this may not be problematic in this specific case, it could lead to very difficult to track bugs. Then in both cases you have over-thought the time comparison. LocalTime has a high ...


2

TimeRangePredicateSupplier To me, this name seems wrong. The implementations are providing a time based greeting, so perhaps TimeBasedGreetingSupplier might be better. Afternoon The way you've coded AfternoonPredicateSupplier it knows too much about how it's used. Whilst the afternoon doesn't have a particular requirement, since you've coded it, it would ...


Only top voted, non community-wiki answers of a minimum length are eligible