Self (final T @NotNull ... values) { final Collection<T> list; final int length = values.length; if (length == 1) { list = Collections.singletonList(values[0]); } else if (length >= 11) { list = ContainerUtil.newHashSet(values); } else { list = Arrays.asList(values); } return with(new ValuePatternCondition<T>("oneOf") { @Override public Collection<T> getValues() { return list; } @Override public boolean accepts(@NotNull T t, ProcessingContext context) { return list.contains(t); } }); }