TreeElement (@NotNull Project project) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); return (TreeElement)Objects.requireNonNull(factory.createReferenceFromText("foo", null).getParameterList()).getNode(); }