boolean (PsiElement @NotNull [] elements) { if (elements.length > 1) return false; for (PsiElement element : elements) { if (!(element instanceof PsiMethod || element instanceof PsiVariable)) { return false; } } return true; }