static ObjectStubSerializer<Stub, Stub> getSerializer(@NotNull Stub rootStub) {
    if (rootStub instanceof PsiFileStub) {
      //noinspection unchecked
      return ((PsiFileStub)rootStub).getType();
    }
    //noinspection unchecked
    return (ObjectStubSerializer<Stub, Stub>)rootStub.getStubType();
  }
static ObjectStubSerializer<Stub, Stub> getSerializer(@NotNull Stub rootStub)