private static int resolveFirstDayOfWeek(String firstDayOfWeek) {
        if (firstDayOfWeek.equalsIgnoreCase("sunday")) {
            return SUNDAY;
        }
        else if (firstDayOfWeek.equalsIgnoreCase("monday")) {
            return MONDAY;
        }
        else if (firstDayOfWeek.equalsIgnoreCase("tuesday")) {
            return TUESDAY;
        }
        else if (firstDayOfWeek.equalsIgnoreCase("wednesday")) {
            return WEDNESDAY;
        }
        else if (firstDayOfWeek.equalsIgnoreCase("thursday")) {
            return THURSDAY;
        }
        else if (firstDayOfWeek.equalsIgnoreCase("friday")) {
            return FRIDAY;
        }
        else if (firstDayOfWeek.equalsIgnoreCase("saturday")) {
            return SATURDAY;
        }
        throw new IllegalArgumentException("Never heard for this day of week: " + firstDayOfWeek);
    }