presto-client/src/main/java/io/prestosql/client/IntervalYearMonth.java/IntervalYearMonth/parseMonths
class IntervalYearMonth:    public static int parseMonths(String value)
    {
        if (value.equals(INT_MIN_VALUE)) {
            return Integer.MIN_VALUE;
        }

        int signum = 1;
        if (value.startsWith("-")) {
            signum = -1;
            value = value.substring(1);
        }

        Matcher matcher = FORMAT.matcher(value);
        if (!matcher.matches()) {
            throw new IllegalArgumentException("Invalid year-month interval: " + value);
        }

        int years = parseInt(matcher.group(1));
        int months = parseInt(matcher.group(2));

        return toMonths(years, months) * signum;
    }