Tabnine Logo
Multiset.isEmpty
Code IndexAdd Tabnine to your IDE (free)

How to use
isEmpty
method
in
com.google.common.collect.Multiset

Best Java code snippets using com.google.common.collect.Multiset.isEmpty (Showing top 20 results out of 504)

origin: google/guava

@Override
public boolean isEmpty() {
 return multiset1.isEmpty() && multiset2.isEmpty();
}
origin: google/guava

@Override
public boolean isEmpty() {
 return multiset1.isEmpty() && multiset2.isEmpty();
}
origin: google/guava

/** A specialization of {@code addAllImpl} for when {@code elements} is itself a Multiset. */
private static <E> boolean addAllImpl(Multiset<E> self, Multiset<? extends E> elements) {
 if (elements.isEmpty()) {
  return false;
 }
 elements.forEachEntry(self::add);
 return true;
}
origin: google/guava

@Override
public boolean isEmpty() {
 return multiset().isEmpty();
}
origin: google/guava

 @VisibleForTesting
 ImmutableMultiset<E> buildJdkBacked() {
  if (contents.isEmpty()) {
   return of();
  }
  return JdkBackedImmutableMultiset.create(contents.entrySet());
 }
}
origin: google/guava

@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testEntrySet_clear() {
 getMultiset().entrySet().clear();
 assertTrue("multiset not empty after entrySet().clear()", getMultiset().isEmpty());
}
origin: google/guava

public void testCopyOf_multiset_empty() {
 Multiset<String> c = HashMultiset.create();
 Multiset<String> multiset = ImmutableMultiset.copyOf(c);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_multiset_empty() {
 Multiset<String> c = HashMultiset.create();
 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testRemoveOccurrencesMultisetEmpty() {
 Multiset<String> multiset = HashMultiset.create();
 Multiset<String> toRemove = HashMultiset.create(Arrays.asList("a", "b", "a"));
 assertFalse(Multisets.removeOccurrences(multiset, toRemove));
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testRetainEmptyOccurrences() {
 Multiset<String> multiset = HashMultiset.create(Arrays.asList("a", "b", "a"));
 Multiset<String> toRetain = HashMultiset.create();
 assertTrue(Multisets.retainOccurrences(multiset, toRetain));
 assertTrue(multiset.isEmpty());
}
origin: google/guava

@CollectionSize.Require(ONE)
@CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE)
public void testEntrySet_iteratorRemovePropagates() {
 Iterator<Multiset.Entry<E>> iterator = getMultiset().entrySet().iterator();
 assertTrue(
   "non-empty multiset.entrySet() iterator.hasNext() returned false", iterator.hasNext());
 assertEquals(
   "multiset.entrySet() iterator.next() returned incorrect entry",
   Multisets.immutableEntry(e0(), 1),
   iterator.next());
 assertFalse(
   "size 1 multiset.entrySet() iterator.hasNext() returned true after next()",
   iterator.hasNext());
 iterator.remove();
 assertTrue(
   "multiset isn't empty after multiset.entrySet() iterator.remove()",
   getMultiset().isEmpty());
}
origin: google/guava

public void testRemoveOccurrencesIterableEmpty() {
 Multiset<String> multiset = HashMultiset.create();
 Iterable<String> toRemove = Arrays.asList("a", "b", "a");
 assertFalse(Multisets.removeOccurrences(multiset, toRemove));
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCreation_emptyArray() {
 String[] array = new String[0];
 Multiset<String> multiset = ImmutableMultiset.copyOf(array);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCreation_emptyArray() {
 String[] array = new String[0];
 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(array);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCreation_noArgs() {
 Multiset<String> multiset = ImmutableMultiset.of();
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCreation_noArgs() {
 Multiset<String> multiset = ImmutableSortedMultiset.of();
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_iterator_empty() {
 Iterator<String> iterator = Iterators.emptyIterator();
 Multiset<String> multiset = ImmutableMultiset.copyOf(iterator);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_collection_empty() {
 // "<String>" is required to work around a javac 1.5 bug.
 Collection<String> c = MinimalCollection.<String>of();
 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_collection_empty() {
 // "<String>" is required to work around a javac 1.5 bug.
 Collection<String> c = MinimalCollection.<String>of();
 Multiset<String> multiset = ImmutableMultiset.copyOf(c);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_iterator_empty() {
 Iterator<String> iterator = Iterators.emptyIterator();
 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(iterator);
 assertTrue(multiset.isEmpty());
}
com.google.common.collectMultisetisEmpty

Popular methods of Multiset

  • add
    Adds a number of occurrences of an element to this multiset. Note that if occurrences == 1, this met
  • count
    Returns the number of occurrences of an element in this multiset (thecount of the element). Note tha
  • elementSet
    Returns the set of distinct elements contained in this multiset. The element set is backed by the sa
  • entrySet
    Returns a view of the contents of this multiset, grouped into Multiset.Entry instances, each providi
  • remove
    Removes a number of occurrences of the specified element from this multiset. If the multiset contain
  • size
    Returns the total number of all occurrences of all elements in this multiset. Note: this method does
  • clear
  • contains
    Determines whether this multiset contains the specified element.This method refines Collection#conta
  • addAll
  • setCount
    Conditionally sets the count of an element to a new value, as described in #setCount(Object,int), pr
  • iterator
    Elements that occur multiple times in the multiset will appear multiple times in this iterator, thou
  • equals
    Compares the specified object with this multiset for equality. Returns true if the given object is a
  • iterator,
  • equals,
  • containsAll,
  • hashCode,
  • removeAll,
  • toString,
  • stream,
  • forEachEntry,
  • retainAll

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • Menu (java.awt)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Path (java.nio.file)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JLabel (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now