title: LocalTime between 23.59 and 00:01
body: <p>I want to check if a <code>LocalTime</code> is midnight. For this use case midnight is defined as anything in between <code>23:59</code> and <code>00:01</code>. That is a range of <strong>2 minutes</strong>.</p>
  
  <pre><code>private final LocalTime ONE_MINUTE_BEFORE_MIDNIGHT = LocalTime.of(23, 59, 0);
  private final LocalTime ONE_MINUTE_AFTER_MIDNIGHT = LocalTime.of(0, 1, 0);
  </code></pre>
  
  <p>I have a method </p>
  
  <pre><code>public boolean isAtMidnight(LocalTime time) {
      return time.isAfter(ONE_MINUTE_BEFORE_MIDNIGHT)
          &amp;&amp; time.isBefore(ONE_MINUTE_AFTER_MIDNIGHT);
  }
  </code></pre>
  
  <p>This method is <strong>always</strong> returning <code>false</code>. Even for <code>LocalTime.MIDNIGHT</code>. it should, however, return <code>true</code>.</p>
  
  <p>How can I check if the time is <code>+-1</code> minute from midnight?</p>