Self (final Collection<T> set) { return with(new ValuePatternCondition<T>("oneOf") { @Override public Collection<T> getValues() { return set; } @Override public boolean accepts(@NotNull T t, ProcessingContext context) { return set.contains(t); } }); }