Java 8 LocalDate - How do I get all dates between two dates? : <p>Is there a usablility to get <strong>all dates between two dates</strong> in the new <code>java.time</code> API?</p>

<p>Let's say I have this part of code:</p>

<pre><code>@Test
public void testGenerateChartCalendarData() {
    LocalDate startDate = LocalDate.now();

    LocalDate endDate = startDate.plusMonths(1);
    endDate = endDate.withDayOfMonth(endDate.lengthOfMonth());
}
</code></pre>

<p>Now I need all dates between <code>startDate</code> and <code>endDate</code>.</p>

<p>I was thinking to get the <code>daysBetween</code> of the two dates and iterate over:</p>

<pre><code>long daysBetween = ChronoUnit.DAYS.between(startDate, endDate);

for(int i = 0; i &lt;= daysBetween; i++){
    startDate.plusDays(i); //...do the stuff with the new date...
}
</code></pre>

<p>Is there a better way to get the dates?</p>
