@Override public <T> MutableSet<T> with(T... items) { return UnifiedSet.newSetWith(items); }
@Override public <T> MutableSet<T> with(T... items) { return UnifiedSet.newSetWith(items); }
public static <T> ImmutableSet<T> newSetWith(T... elements) { return new ImmutableUnifiedSet<>(UnifiedSet.newSetWith(elements)); }
public static Predicates<Object> notIn(Object... array) { if (array.length <= SMALL_COLLECTION_THRESHOLD) { return new NotInCollectionPredicate(Arrays.asList(array)); } return new NotInSetIterablePredicate(UnifiedSet.newSetWith(array)); }
public static Predicates<Object> in(Object... array) { if (array.length <= SMALL_COLLECTION_THRESHOLD) { return new InCollectionPredicate(Arrays.asList(array)); } return new InSetIterablePredicate(UnifiedSet.newSetWith(array)); }
public static Predicates<Object> in(Object... array) { if (array.length <= SMALL_COLLECTION_THRESHOLD) { return new InCollectionPredicate(Arrays.asList(array)); } return new InSetIterablePredicate(UnifiedSet.newSetWith(array)); }
public static Predicates<Object> notIn(Object... array) { if (array.length <= SMALL_COLLECTION_THRESHOLD) { return new NotInCollectionPredicate(Arrays.asList(array)); } return new NotInSetIterablePredicate(UnifiedSet.newSetWith(array)); }
@Override public <V> ImmutableSet<V> collect(CharToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
@Override public <V> ImmutableSet<V> collect(ShortToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
@Override public <V> ImmutableSet<V> collect(LongToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
@Override public <V> ImmutableSet<V> collect(DoubleToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
@Override public <V> ImmutableSet<V> collect(FloatToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
@Override public <V> ImmutableSet<V> collect(IntToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
@Override public <V> ImmutableSet<V> collect(CharToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
@Override public <V> ImmutableSet<V> collect(DoubleToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
@Override public <V> ImmutableSet<V> collect(ByteToObjectFunction<? extends V> function) { return UnifiedSet.<V>newSetWith(function.valueOf(this.element)).toImmutable(); }
public static <T> MutableSet<MutableSet<T>> powerSet(Set<T> set) { MutableSet<MutableSet<T>> seed = UnifiedSet.newSetWith(UnifiedSet.newSet()); return powerSetWithSeed(set, seed); }
public static <T> MutableSet<MutableSet<T>> powerSet(UnifiedSetWithHashingStrategy<T> set) { MutableSet<MutableSet<T>> seed = UnifiedSet.newSetWith(set.newEmpty()); return powerSetWithSeed(set, seed); }
private void assertContains( Iterable<NodeWithPropertyValues> iterable, NodeWithPropertyValues... expected ) { assertEquals( UnifiedSet.newSetWith( expected ), UnifiedSet.newSet( iterable ) ); }
public static <T> MutableSet<MutableSet<T>> powerSet(Set<T> set) { MutableSet<MutableSet<T>> seed = UnifiedSet.newSetWith(UnifiedSet.newSet()); return Iterate.injectInto(seed, set, (accumulator, element) -> Sets.union(accumulator, accumulator.collect(innerSet -> innerSet.toSet().with(element)))); }