boolean (@NotNull PsiClass aClass, @NotNull Document document, @NotNull List<? super FoldingDescriptor> list, @NotNull Set<? super PsiElement> processedComments, boolean quick) { if (!JavaCodeFoldingSettings.getInstance().isCollapseLambdas()) { return false; } if (aClass instanceof PsiAnonymousClass) { final PsiAnonymousClass anonymousClass = (PsiAnonymousClass)aClass; ClosureFolding closureFolding = ClosureFolding.prepare(anonymousClass, quick, this); List<FoldingDescriptor> descriptors = closureFolding == null ? null : closureFolding.process(document); if (descriptors != null) { list.addAll(descriptors); addCodeBlockFolds(list, closureFolding.methodBody, processedComments, document, quick); return true; } } return false; }