Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (C) 2012 The Guava Authors
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  * http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.common.collect.testing.google;
import static com.google.common.collect.testing.features.CollectionSize.SEVERAL;
import static com.google.common.collect.testing.features.CollectionSize.ZERO;
import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_KEYS;
import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_QUERIES;
import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE;
import static org.junit.contrib.truth.Truth.ASSERT;
Tests for Multimap.removeAll(Object).

Author(s):
Louis Wasserman
public class MultimapRemoveAllTester<K, V> extends AbstractMultimapTester<K, V> {
  public void testRemoveAllAbsentKey() {
    ASSERT.that(multimap().removeAll(sampleKeys().)).isEmpty();
  }
  @CollectionSize.Require(absent = )
  public void testRemoveAllPresentKey() {
    ASSERT.that(multimap().removeAll(sampleKeys().)).hasContentsInOrder(
        sampleValues().);
  }
  @CollectionSize.Require(absent = )
  public void testRemoveAllPropagatesToGet() {
    Collection<V> getResult = multimap().get(sampleKeys().);
    ASSERT.that(getResult).isEmpty();
  }
  public void testRemoveAllMultipleValues() {
        Helpers.mapEntry(sampleKeys().sampleValues().),
        Helpers.mapEntry(sampleKeys().sampleValues().),
        Helpers.mapEntry(sampleKeys().sampleValues().));
    ASSERT.that(multimap().removeAll(sampleKeys().))
        .hasContentsAnyOrder(sampleValues().sampleValues().sampleValues().);
  }
  @CollectionSize.Require(absent = )
  public void testRemoveAllNullKeyPresent() {
    ASSERT.that(multimap().removeAll(null)).hasContentsInOrder(getValueForNullKey());
    expectMissing(Helpers.mapEntry((K) nullgetValueForNullKey()));
  }
  public void testRemoveAllNullKeyAbsent() {
    ASSERT.that(multimap().removeAll(null)).isEmpty();
  }
New to GrepCode? Check out our FAQ X