Self (final int minLength) { return with(new PatternCondition<T>("withTextLengthLongerThan") { @Override public boolean accepts(@NotNull T t, ProcessingContext context) { return t.getTextLength() > minLength; } }); }