boolean (PsiElement @NotNull [] elements) { if (elements.length == 0) return false; for (PsiElement element : elements) { if (!isStatement(element)) return false; } if (elements[0] instanceof GrBlockStatement) { return false; } return true; }