public static Duration parse(String str) {
        if (StringUtils.isBlank(str)) {
            return DEFAULT_DURATION;
        }

        if (SIMPLE.matcher(str).matches()) {
            if (str.contains(MILLIS_SECOND_UNIT)) {
                long value = doParse(MILLIS_SECOND_UNIT, str);
                return Duration.ofMillis(value);
            } else if (str.contains(DAY_UNIT)) {
                long value = doParse(DAY_UNIT, str);
                return Duration.ofDays(value);
            } else if (str.contains(HOUR_UNIT)) {
                long value = doParse(HOUR_UNIT, str);
                return Duration.ofHours(value);
            } else if (str.contains(MINUTE_UNIT)) {
                long value = doParse(MINUTE_UNIT, str);
                return Duration.ofMinutes(value);
            } else if (str.contains(SECOND_UNIT)) {
                long value = doParse(SECOND_UNIT, str);
                return Duration.ofSeconds(value);
            } else {
                throw new UnsupportedOperationException("\"" + str + "\" can't parse to Duration");
            }
        }

        try {
            if (ISO8601.matcher(str).matches()) {
                return Duration.parse(str);
            }
        } catch (DateTimeParseException e) {
            throw new UnsupportedOperationException("\"" + str + "\" can't parse to Duration", e);
        }

        try {
            int millis = Integer.parseInt(str);
            return Duration.ofMillis(millis);
        } catch (Exception e) {
            throw new UnsupportedOperationException("\"" + str + "\" can't parse to Duration", e);
        }
    }
@Test
    public void testParseThrowException() {
        Assertions.assertThrows(UnsupportedOperationException.class,
                () -> DurationUtil.parse("a"));

        Assertions.assertThrows(UnsupportedOperationException.class,
                () -> DurationUtil.parse("as"));

        Assertions.assertThrows(UnsupportedOperationException.class,
                () -> DurationUtil.parse("d"));

        Assertions.assertThrows(UnsupportedOperationException.class,
                () -> DurationUtil.parse("h"));

        Assertions.assertThrows(UnsupportedOperationException.class,
                () -> DurationUtil.parse("m"));

        Assertions.assertThrows(UnsupportedOperationException.class,
                () -> DurationUtil.parse("s"));

        Assertions.assertThrows(UnsupportedOperationException.class,
                () -> DurationUtil.parse("ms"));
    }