SubstrateRef (@NotNull StubBasedPsiElementBase<?> psi) { return new SubstrateRef() { @Override public @NotNull ASTNode getNode() { throw new PsiInvalidElementAccessException(psi); } @Override public boolean isValid() { return false; } @Override public @NotNull PsiFile getContainingFile() { throw new PsiInvalidElementAccessException(psi); } }; }