PsiElementPredicate () { return new PsiElementPredicate() { @Override public boolean satisfiedBy(@NotNull PsiElement element) { if (!(element instanceof GrLiteral)) return false; final Object value = ((GrLiteral)element).getValue(); return value instanceof String && ((String)value).length() == 1; } }; }