code: private static int getWeekOfYear(PlainDate date) {
  
          int dayOfYear = date.getDayOfYear();
          int wCurrent = getFirstCalendarWeekAsDayOfYear(date, 0);
  
          if (wCurrent <= dayOfYear) {
              int result = ((dayOfYear - wCurrent) / 7) + 1;
  
              if (result >= 53) { // Optimierung
                  int wNext =
                      getFirstCalendarWeekAsDayOfYear(date, 1)
                      + getLengthOfYear(date, 0);
                  if (wNext <= dayOfYear) {
                      result = 1;
                  }
              }
  
              return result;
          } else {
              int wPrevious = getFirstCalendarWeekAsDayOfYear(date, -1);
              int dayCurrent = dayOfYear + getLengthOfYear(date, -1);
              return ((dayCurrent - wPrevious) / 7) + 1;
          }
  
      }
docs: Optimierung als Ersatz für date.getWeekOfYear()