See the following running example to get next Sunday by using java 8:-
package com.java8.date;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;
public class GetNextSunday {
public static void main(String[] args) {
//get the next Sunday
LocalDate today = LocalDate.now();
LocalDate nextTuesday = today.with(TemporalAdjusters.next(DayOfWeek.SUNDAY));
System.out.println("Today: "+today);
System.out.println("Next Sunday : " + nextTuesday);
}
}
Output:-
Today: 2019-01-31
Next Sunday : 2019-02-03