import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.TemporalAdjusters;

public class Main {
	public static void main(String[] args) {
		// Replace JVM's ZoneId, ZoneId.systemDefault() with the applicable one e.g.
		// ZoneId.of("America/Los_Angeles")
		LocalDate today = LocalDate.now(ZoneId.systemDefault());

		// Next Sunday
		LocalDate nextSun = today.with(TemporalAdjusters.next(DayOfWeek.SUNDAY));
		System.out.println(nextSun);

		// Same (if it's Sunday today) of next Sunday
		LocalDate sameOrNextSun = today.with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY));
		System.out.println(sameOrNextSun);

		// Previous Sunday
		LocalDate previousSun = today.with(TemporalAdjusters.previous(DayOfWeek.SUNDAY));
		System.out.println(previousSun);

		// Same (if it's Sunday today) of previous Sunday
		LocalDate sameOrPreviousSun = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.SUNDAY));
		System.out.println(sameOrPreviousSun);
	}
}