title: Java 8 time: Iterate over a day's LocalTime in period steps
body: <p>Starting at midnight, I want to iterate over <code>LocalTime</code>s in steps of a certain period length to the end of the day. </p>
  
  <p>Eg. if the period is 8hr10Minutes I would like times: 0:00, 8:10, 16:20 (not 24:30 as this is the next day)</p>
  
  <p>I have the following working code for periods smaller than one day. Is there a better (esp. more readable) logic?</p>
  
  <pre><code>Duration period = ...;
  for(LocalTime t = LocalTime.MIDNIGHT, p = LocalTime.MIDNIGHT;
              t.isAfter(p) || t.equals(p) ; p = t, t = t.plus(period)){
      // do something with t
  }
  </code></pre>
  
  <p>Also, the above fails for periods equal to multiples of one day (infinite loop) or, if greater than one day, returns the number as if the period was cast to be shorter than one day, (eg. 24hr10min behaves the same as 10Minutes), so if that can be fixed at the same time (without explicit <code>if</code>s) I'll take it as well.</p>