import java.time.temporal.TemporalAdjusters.firstInMonth
import java.time.temporal.{ChronoField, IsoFields}
import java.time.{DayOfWeek, LocalDate, Month}

import scala.util.{Failure, Try}

private object LongYear extends App {
  private val (currentCentury, maxWeekNumber) = (LocalDate.now().getYear / 100, ChronoField.ALIGNED_WEEK_OF_YEAR.range().getMaximum)
  private val centuries = currentCentury * 100 until (currentCentury + 1) * 100
  private val results = List(
    centuries.filter(isThursdayFirstOrLast),
    centuries.filter(year => maxIsoWeeks(year) == maxWeekNumber),
    centuries.filter(mostThursdaysInYear)
  )