code: protected final boolean isDurationValid() {
  
          if (isValidEndTypeForPattern()) {
              switch (getEndType()) {
                  case DATE:
                      return (getStart().getTime() < (getSeriesEndDate().getTime() + DAY_IN_MILLIS));
                  case TIMES:
                      return getOccurrences() > 0;
                  case SINGLE:
                      return true;
                  default:
                      return false;
              }
          } else {
              return false;
          }
      }
docs: Checks if the duration option is valid.
  
  NOTE: This does NOT check, if too many events are specified.
  
  @return a flag, indicating if the duration option is valid.