docs: protected DeclaredType resolveTypeVariable(Element element, TypeVariable typeVariable) {
          Element enclosing = element.getEnclosingElement();
  
          while (enclosing instanceof Parameterizable) {
              Parameterizable parameterizable = (Parameterizable) enclosing;
              String name = typeVariable.toString();
              for (TypeParameterElement typeParameter : parameterizable.getTypeParameters()) {
                  if (name.equals(typeParameter.toString())) {
                      List<? extends TypeMirror> bounds = typeParameter.getBounds();
                      if (bounds.size() == 1) {
                          TypeMirror typeMirror = bounds.get(0);
                          if (typeMirror.getKind() == TypeKind.DECLARED) {
                              return (DeclaredType) typeMirror;
                          }
                      }
                  }
              }
              enclosing = enclosing.getEnclosingElement();
          }
          return null;
      }