Self (final ElementPattern<? extends T> filePattern) { return with(new PatternCondition<T>("withOriginalFile") { @Override public boolean accepts(@NotNull T file, ProcessingContext context) { return filePattern.accepts(file.getOriginalFile()); } }); }