### Question:
LocalTimeRange extends Range<LocalTime> { public static LocalTimeRange before(final LocalTime before) { if (before == null) { throw new IllegalArgumentException("range cannot be before null"); } if (before.equals(LocalTime.MIN)) { throw new IllegalArgumentException("range cannot be before the minimum time"); } return new LocalTimeRange(MINIMUM, before.minusNanos(1)); } private  LocalTimeRange(final LocalTime lowerBound, final LocalTime upperBound); static LocalTimeRange between(final int startHour, final int endHour); static LocalTimeRange midnight(); static LocalTimeRange endOfDay(); static LocalTimeRange startOfDay(); static LocalTimeRange noon(); static LocalTimeRange beforeNoon(); static LocalTimeRange afterNoon(); static LocalTimeRange now(); static LocalTimeRange all(); static LocalTimeRange after(final LocalTime after); static LocalTimeRange before(final LocalTime before);  }### Answer:
@Test public void beforeTime() { final LocalTime time = RDG.localTime().next(); final LocalTimeRange before = LocalTimeRange.before(time); assertThat(before.lowerBound()).isEqualTo(MIN); assertThat(before.upperBound()).isEqualTo(time.minusNanos(1)); }
@Test public void cannotBeBeforeNull() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("range cannot be before null"); before(null); }
@Test public void cannotBeBeforeMinimumTime() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("range cannot be before the minimum time"); before(LocalTime.MIN); }