docs: public static final long parseDuration(final String duration) {
      long interval;
      long multiplier;
      double temp;
      int unit = 0;
      while (Character.isDigit(duration.charAt(unit))) {
        unit++;
        if (unit >= duration.length()) {
          throw new IllegalArgumentException("Invalid duration, must have an "
              + "integer and unit: " + duration);
        }
      }
      try {
        interval = Long.parseLong(duration.substring(0, unit));
      } catch (NumberFormatException e) {
        throw new IllegalArgumentException("Invalid duration (number): " + duration);
      }
      if (interval <= 0) {
        throw new IllegalArgumentException("Zero or negative duration: " + duration);
      }
      switch (duration.toLowerCase().charAt(duration.length() - 1)) {
        case 's': 
          if (duration.charAt(duration.length() - 2) == 'm') {
            return interval;
          }
          multiplier = 1; break;                        // seconds
        case 'm': multiplier = 60; break;               // minutes
        case 'h': multiplier = 3600; break;             // hours
        case 'd': multiplier = 3600 * 24; break;        // days
        case 'w': multiplier = 3600 * 24 * 7; break;    // weeks
        case 'n': multiplier = 3600 * 24 * 30; break;   // month (average)
        case 'y': multiplier = 3600 * 24 * 365; break;  // years (screw leap years)
        default: throw new IllegalArgumentException("Invalid duration (suffix): " + duration);
      }
      multiplier *= 1000;
      temp = (double)interval * multiplier;
      if (temp > Long.MAX_VALUE) {
        throw new IllegalArgumentException("Duration must be < Long.MAX_VALUE ms: " + duration);
      }
      return interval * multiplier;
    }