public static @NotNull <S> Class<S> getStateClass(@NotNull Class<? extends PersistentStateComponent> aClass) {
    TypeVariable<Class<PersistentStateComponent>> variable = PersistentStateComponent.class.getTypeParameters()[0];
    Type type = ClassUtil.resolveVariableInHierarchy(variable, aClass);
    assert type != null : aClass;
    @SuppressWarnings("unchecked") Class<S> result = (Class<S>)ClassUtil.getRawType(type);
    if (result == Object.class) {
      //noinspection unchecked
      return (Class<S>)aClass;
    }
    return result;
  }
public static @NotNull <S> Class<S> getStateClass(@NotNull Class<? extends PersistentStateComponent> aClass)