10888a09821a98ac0680fad765217302858e70fa4Paul Duffin/*
20888a09821a98ac0680fad765217302858e70fa4Paul Duffin * Copyright (C) 2012 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.SEVERAL;
180888a09821a98ac0680fad765217302858e70fa4Paul Duffin
190888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport com.google.common.annotations.GwtCompatible;
200888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport com.google.common.collect.SetMultimap;
210888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport com.google.common.collect.testing.Helpers;
220888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport com.google.common.collect.testing.features.CollectionSize;
230888a09821a98ac0680fad765217302858e70fa4Paul Duffinimport com.google.common.testing.EqualsTester;
240888a09821a98ac0680fad765217302858e70fa4Paul Duffin
250888a09821a98ac0680fad765217302858e70fa4Paul Duffin/**
260888a09821a98ac0680fad765217302858e70fa4Paul Duffin * Testers for {@link SetMultimap#equals(Object)}.
270888a09821a98ac0680fad765217302858e70fa4Paul Duffin *
280888a09821a98ac0680fad765217302858e70fa4Paul Duffin * @author Louis Wasserman
290888a09821a98ac0680fad765217302858e70fa4Paul Duffin */
300888a09821a98ac0680fad765217302858e70fa4Paul Duffin@GwtCompatible
310888a09821a98ac0680fad765217302858e70fa4Paul Duffinpublic class SetMultimapEqualsTester<K, V>
320888a09821a98ac0680fad765217302858e70fa4Paul Duffin    extends AbstractMultimapTester<K, V, SetMultimap<K, V>> {
330888a09821a98ac0680fad765217302858e70fa4Paul Duffin  @CollectionSize.Require(SEVERAL)
340888a09821a98ac0680fad765217302858e70fa4Paul Duffin  public void testOrderingDoesntAffectEqualsComparisons() {
350888a09821a98ac0680fad765217302858e70fa4Paul Duffin    SetMultimap<K, V> multimap1 = getSubjectGenerator().create(
360888a09821a98ac0680fad765217302858e70fa4Paul Duffin        Helpers.mapEntry(sampleKeys().e0, sampleValues().e0),
370888a09821a98ac0680fad765217302858e70fa4Paul Duffin        Helpers.mapEntry(sampleKeys().e0, sampleValues().e1),
380888a09821a98ac0680fad765217302858e70fa4Paul Duffin        Helpers.mapEntry(sampleKeys().e0, sampleValues().e4));
390888a09821a98ac0680fad765217302858e70fa4Paul Duffin    SetMultimap<K, V> multimap2 = getSubjectGenerator().create(
400888a09821a98ac0680fad765217302858e70fa4Paul Duffin        Helpers.mapEntry(sampleKeys().e0, sampleValues().e1),
410888a09821a98ac0680fad765217302858e70fa4Paul Duffin        Helpers.mapEntry(sampleKeys().e0, sampleValues().e0),
420888a09821a98ac0680fad765217302858e70fa4Paul Duffin        Helpers.mapEntry(sampleKeys().e0, sampleValues().e4));
430888a09821a98ac0680fad765217302858e70fa4Paul Duffin    new EqualsTester()
440888a09821a98ac0680fad765217302858e70fa4Paul Duffin        .addEqualityGroup(multimap1, multimap2)
450888a09821a98ac0680fad765217302858e70fa4Paul Duffin        .testEquals();
460888a09821a98ac0680fad765217302858e70fa4Paul Duffin  }
470888a09821a98ac0680fad765217302858e70fa4Paul Duffin}
48