GrStatement[] (PsiElement[] elements) { ArrayList<GrStatement> statementList = new ArrayList<>(); for (PsiElement element : elements) { if (element instanceof GrStatement) { statementList.add(((GrStatement)element)); } } return statementList.toArray(GrStatement.EMPTY_ARRAY); }