TypeParam[] params = getAssociatedWrapper().getTypeParams(); for (int i = 0; i < params.length; i++) { if (params[i] == this) return base + i; } throw new RuntimeException("TypeParam not found in associated class or method");
return -1;
  public int getIndex() {    int base = 0;    GenericWrapper container = associatedWrapper.getContainingWrapper();    while (container != null) {      if (container.getTypeParams() != null) {        base += container.getTypeParams().length;      }      container = container.getContainingWrapper();    }    TypeParam[] params = getAssociatedWrapper().getTypeParams();    for (int i = 0; i < params.length; i++) {      if (params[i] == this) return base + i;    }    throw new RuntimeException("TypeParam not found in associated class or method");  }