All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bbn.bue.common.collections.SetUtils Maven / Gradle / Ivy

The newest version!
package com.bbn.bue.common.collections;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;

/**
 * Utilities related to {@link java.util.Set}s.
 */
public final class SetUtils {

  private SetUtils() {
    throw new UnsupportedOperationException();
  }

  /**
   * Returns all items found in the {@code left} iterable not found in the {@code right}.  If the
   * iterables are not deterministic, this will reflect a single pass through each.  This is not a
   * view.
   */
  public static  Sets.SetView differenceAsSets(Iterable left, Iterable right) {
    return Sets.difference(ImmutableSet.copyOf(left), ImmutableSet.copyOf(right));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy