Filter<PsiClass> (@Nullable final ClassFilter classFilter) { if (classFilter == null) { return null; } else { return new Filter<>() { @Override public boolean isAccepted(final PsiClass element) { return ReadAction.compute(() -> DumbService.getInstance(element.getProject()).isDumb() || classFilter.isAccepted(element)); } }; } }