Self (final @NotNull ElementPattern<Collection<ParentType>> pattern) { return with(new PatternConditionPlus<T, Collection<ParentType>>("withChildren", pattern) { @Override public boolean processValues(T t, ProcessingContext context, PairProcessor<? super Collection<ParentType>, ? super ProcessingContext> processor) { return processor.process(Arrays.asList(getChildren(t)), context); } }); }