code: public static Day getNthOfMonth(int n, int dayOfWeek, int month, int year)
    {
      // Validate the dayOfWeek argument
      if (dayOfWeek < 0 || dayOfWeek > 6)
        throw new IllegalArgumentException("Invalid day of week: " + dayOfWeek);
  
      LocalDateTime localDateTime = LocalDateTime.of(year, month, 0, 0, 0);
      return new Day(localDateTime
      		.with(TemporalAdjusters
      		.next(DayOfWeek.of(dayOfWeek)))
      				.toLocalDate());
    }
docs: Find the n'th xxxxday of s specified month (for instance find 1st sunday
  of May 2006; findNthOfMonth (1, Calendar.SUNDAY, Calendar.MAY, 2006);
  Return null if the specified day doesn't exists.
  
  @param n          Nth day to look for.
  @param dayOfWeek  Day to look for (Calendar.XXXDAY).
  @param month      Month to check (Calendar.XXX).
  @param year       Year to check.
  @return           Required Day (or null if non-existent)
  @throws IllegalArgumentException if dyaOfWeek parameter
  doesn't represent a valid day.