package org.puller;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjuster;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.List;

public class Dates {
    public static List<LocalDate> getWednesdays(final LocalDate from, final LocalDate to) {
        final List<LocalDate> wednesdays = new ArrayList<>();

        LocalDate nextWednesday = from.with(TemporalAdjusters.nextOrSame(DayOfWeek.WEDNESDAY));
        while (nextWednesday.isBefore(to) || nextWednesday.isEqual(to)) {
            wednesdays.add(nextWednesday);
            nextWednesday = nextWednesday.with(TemporalAdjusters.next(DayOfWeek.WEDNESDAY));
        }

        return wednesdays;
    }
}

@@ -91,33 +91,14 @@
 ime.
-temporal.TemporalAdjuster
+Period
 ;%0Aim
@@ -111,39 +111,17 @@
 ava.
+u
 ti
-me.temporal.TemporalAdjusters
+l.List
 ;%0Aim
@@ -135,25 +135,33 @@
 va.util.
-ArrayList
+stream.Collectors
 ;%0Aimport
@@ -171,20 +171,29 @@
 va.util.
-Li
 st
+ream.Stream
 ;%0A%0Apubli
@@ -318,269 +318,149 @@
 nal 
-List%3CLocalDate%3E wednesdays = new ArrayList%3C%3E();%0A%0A        LocalDate nextWednesday = from.with(TemporalAdjusters.nextOrSame(DayOfWeek.WEDNESDAY));%0A        while (nextWednesday.isBefore(to) %7C%7C nextWednesday.isEqual(to)) %7B%0A            wednesdays.add(nextWednes
+int days = Period.between(from, to).getDays() + 1;%0A        return Stream.iterate(from, date -%3E date.plusDays(1))%0A                .limit(
 day
+s
 )
-;
 %0A   
@@ -472,66 +472,51 @@
     
-nextWednesday = nextWednesday.with(TemporalAdjusters.next(
+    .filter(date -%3E date.getDayOfWeek() == 
 DayO
@@ -535,10 +535,8 @@
 DAY)
-);
 %0A   
@@ -544,19 +544,16 @@
     
-%7D%0A%0A
         
 retu
@@ -552,25 +552,37 @@
     
-return wednesdays
+.collect(Collectors.toList())
 ;%0A  

Use stream to generate wednesdays