code: public S parse(
          CharSequence text,
          int offset
      ) throws ParseException {
  
          int pos = offset;
          Map<Object, Long> unitsToValues = new HashMap<>();
  
          for (int i = 0, n = this.items.size(); i < n; i++) {
              FormatItem<U> item = this.items.get(i);
  
              if (item == OrItem.INSTANCE) {
                  break;
              }
  
              int reply = item.parse(unitsToValues, text, pos);
  
              if (reply < 0) {
                  int found = -1;
                  for (int j = i + 1; j < n; j++) {
                      if (this.items.get(j) == OrItem.INSTANCE) {
                          found = j;
                          break;
                      }
                  }
                  if (found == -1) {
                      throw new ParseException("Cannot parse: " + text, ~reply);
                  } else {
                      unitsToValues.clear();
                      i = found;
                  }
              } else {
                  pos = reply;
              }
          }
  
          int len = text.length();
  
          if (pos < len) {
              throw new ParseException(
                  "Unparsed trailing characters found: \""
                      + text.subSequence(pos, len)
                      + "\" in \""
                      + text,
                  pos);
          }
  
          Long sign = unitsToValues.remove(SIGN_KEY);
          boolean negative = ((sign != null) && (sign.longValue() < 0));
          Map<U, Long> map = new HashMap<>();
  
          for (Object key : unitsToValues.keySet()) {
              if (this.type.isInstance(key)) {
                  map.put(this.type.cast(key), unitsToValues.get(key));
              } else {
                  throw new ParseException(
                      "Duration type mismatched: " + unitsToValues, pos);
              }
          }
  
          return this.convert(map, negative);
  
      }
docs: /*[deutsch]
  <p>Interpretiert den angegebenen Text entsprechend dem
  voreingestellten Formatmuster als Dauer. </p>
  
  @param   text	custom textual representation to be parsed
  @param   offset  start position for the parser
  @return  parsed duration
  @throws	ParseException (for example in case of mixed signs or if trailing unparsed characters exist)