FileContentPattern (final @NotNull String name) { return with(new PatternCondition<>("withName") { @Override public boolean accepts(@NotNull FileContent fileContent, ProcessingContext context) { return name.equals(fileContent.getFileName()); } }); }