10888a09821a98ac0680fad765217302858e70fa4Paul Duffin/*
20888a09821a98ac0680fad765217302858e70fa4Paul Duffin * Copyright (C) 2013 The Guava Authors
30888a09821a98ac0680fad765217302858e70fa4Paul Duffin *
40888a09821a98ac0680fad765217302858e70fa4Paul Duffin * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
50888a09821a98ac0680fad765217302858e70fa4Paul Duffin * in compliance with the License. You may obtain a copy of the License at
60888a09821a98ac0680fad765217302858e70fa4Paul Duffin *
70888a09821a98ac0680fad765217302858e70fa4Paul Duffin * http://www.apache.org/licenses/LICENSE-2.0
80888a09821a98ac0680fad765217302858e70fa4Paul Duffin *
90888a09821a98ac0680fad765217302858e70fa4Paul Duffin * Unless required by applicable law or agreed to in writing, software distributed under the License
100888a09821a98ac0680fad765217302858e70fa4Paul Duffin * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
110888a09821a98ac0680fad765217302858e70fa4Paul Duffin * or implied. See the License for the specific language governing permissions and limitations under
120888a09821a98ac0680fad765217302858e70fa4Paul Duffin * the License.
130888a09821a98ac0680fad765217302858e70fa4Paul Duffin */
140888a09821a98ac0680fad765217302858e70fa4Paul Duffin
150888a09821a98ac0680fad765217302858e70fa4Paul Duffinpackage com.google.common.collect.testing.google;
160888a09821a98ac0680fad765217302858e70fa4Paul Duffin
170888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport static com.google.common.collect.testing.features.CollectionSize.ZERO;
180888a09821a98ac0680fad765217302858e70fa4Paul Duffin
190888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport com.google.common.annotations.GwtCompatible;
200888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport com.google.common.collect.testing.features.CollectionSize;
210888a09821a98ac0680fad765217302858e70fa4Paul Duffin
220888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport java.util.Arrays;
230888a09821a98ac0680fad765217302858e70fa4Paul Duffin
240888a09821a98ac0680fad765217302858e70fa4Paul Duffin/**
250888a09821a98ac0680fad765217302858e70fa4Paul Duffin * Tests for {@code Multiset.containsAll} not already addressed by {@code CollectionContainsTester}.
260888a09821a98ac0680fad765217302858e70fa4Paul Duffin *
270888a09821a98ac0680fad765217302858e70fa4Paul Duffin * @author Louis Wasserman
280888a09821a98ac0680fad765217302858e70fa4Paul Duffin */
290888a09821a98ac0680fad765217302858e70fa4Paul Duffin@GwtCompatible
300888a09821a98ac0680fad765217302858e70fa4Paul Duffinpublic class MultisetContainsTester<E> extends AbstractMultisetTester<E> {
310888a09821a98ac0680fad765217302858e70fa4Paul Duffin  @CollectionSize.Require(absent = ZERO)
320888a09821a98ac0680fad765217302858e70fa4Paul Duffin  public void testContainsAllMultisetIgnoresFrequency() {
330888a09821a98ac0680fad765217302858e70fa4Paul Duffin    assertTrue(getMultiset()
340888a09821a98ac0680fad765217302858e70fa4Paul Duffin        .containsAll(getSubjectGenerator().create(samples.e0, samples.e0, samples.e0)));
350888a09821a98ac0680fad765217302858e70fa4Paul Duffin  }
360888a09821a98ac0680fad765217302858e70fa4Paul Duffin
370888a09821a98ac0680fad765217302858e70fa4Paul Duffin  @CollectionSize.Require(absent = ZERO)
380888a09821a98ac0680fad765217302858e70fa4Paul Duffin  public void testContainsAllListIgnoresFrequency() {
390888a09821a98ac0680fad765217302858e70fa4Paul Duffin    assertTrue(getMultiset().containsAll(Arrays.asList(samples.e0, samples.e0, samples.e0)));
400888a09821a98ac0680fad765217302858e70fa4Paul Duffin  }
410888a09821a98ac0680fad765217302858e70fa4Paul Duffin}
42