private static DayOfWeek dayFrom(String day) {
        return Arrays.stream(DayOfWeek.values())
                     .filter(dayOfWeek -> day.length() >= 3 && dayOfWeek.name().toLowerCase().startsWith(day))
                     .findFirst()
                     .orElseThrow(() -> new IllegalArgumentException("Invalid day '" + day + "'"));
    }
Parse day of week from string
config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java