code: private static Calendar getCalendar(Date date) {
          Calendar calendar = Calendar.getInstance();
          calendar.setTime(date);
          return calendar;
      }
docs: Utility method to convert a date to a calendar.