private static TypeParameterDeclaration parseTypeParameter(CharIterator signature, TypeInfoProvider mapping) throws ClsFormatException {
    int from = signature.pos();
    while (signature.current() != ':' && signature.current() != CharIterator.DONE) {
      signature.next();
    }
    String name = signature.substring(from);
    if (signature.current() == CharIterator.DONE) {
      throw new ClsFormatException();
    }
    String parameterName = mapping.toTypeInfo(name).text();

    List<TypeInfo> bounds = new SmartList<>();
    while (signature.current() == ':') {
      signature.next();
      TypeInfo bound = parseTopLevelClassRefSignatureToTypeInfo(signature, mapping);
      if (!bounds.isEmpty() && bound == null) continue;
      bounds.add(bound);
    }

    return new TypeParameterDeclaration(parameterName, bounds.toArray(TypeInfo.EMPTY_ARRAY));
  }
private static TypeParameterDeclaration parseTypeParameter(CharIterator signature, TypeInfoProvider mapping)