object FindTheLastSundayOfEachMonth extends App {
  import java.util.Calendar._
  val cal = getInstance

  def lastSundaysOf(year: Int) =
    (JANUARY to DECEMBER).map{month =>
      cal.set(year, month + 1, 1)