code: @Override
      public int getWeeksInWeekYear() {
          GregorianCalendar gc = getNormalizedCalendar();
          int weekYear = gc.getWeekYear();
          if (weekYear == gc.internalGet(YEAR)) {
              return gc.getActualMaximum(WEEK_OF_YEAR);
          }
  
          // Use the 2nd week for calculating the max of WEEK_OF_YEAR
          if (gc == this) {
              gc = (GregorianCalendar) gc.clone();
          }
          gc.setWeekDate(weekYear, 2, internalGet(DAY_OF_WEEK));
          return gc.getActualMaximum(WEEK_OF_YEAR);
      }
docs: Returns the number of weeks in the <a href="#week_year">week year</a>
  represented by this {@code GregorianCalendar}.
  
  <p>For example, if this {@code GregorianCalendar}'s date is
  December 31, 2008 with <a href="#iso8601_compatible_setting">the ISO
  8601 compatible setting</a>, this method will return 53 for the
  period: December 29, 2008 to January 3, 2010 while {@link
  #getActualMaximum(int) getActualMaximum(WEEK_OF_YEAR)} will return
  52 for the period: December 31, 2007 to December 28, 2008.
  
  @return the number of weeks in the week year.
  @see Calendar#WEEK_OF_YEAR
  @see #getWeekYear()
  @see #getActualMaximum(int)
  @since 1.7