Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (C) 2011 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.CollectionFeature.KNOWN_ORDER;
 import static com.google.common.collect.testing.features.CollectionFeature.SUPPORTS_ITERATOR_REMOVE;
 
 
 import java.util.List;

Tester to make sure the iterator().remove() implementation of Multiset works when there are multiple occurrences of elements.

Author(s):
Louis Wasserman
 
 @GwtCompatible(emulated = true)
 public class MultisetIteratorTester<E> extends AbstractMultisetTester<E> {
   @SuppressWarnings("unchecked")
   public void testRemovingIteratorKnownOrder() {
         Arrays.asList(....)),
       @Override
       protected Iterator<E> newTargetIterator() {
         return getSubjectGenerator().create(....)
             .iterator();
       }
     }.test();
   }
 
   @SuppressWarnings("unchecked")
   public void testRemovingIteratorUnknownOrder() {
       @Override
       protected Iterator<E> newTargetIterator() {
         return getSubjectGenerator().create(....)
             .iterator();
       }
     }.test();
   }
 
   @SuppressWarnings("unchecked")
   public void testIteratorKnownOrder() {
         Arrays.asList(....)),
       @Override
       protected Iterator<E> newTargetIterator() {
         return getSubjectGenerator().create(....)
             .iterator();
       }
     }.test();
   }
 
   @SuppressWarnings("unchecked")
   public void testIteratorUnknownOrder() {
       @Override
       protected Iterator<E> newTargetIterator() {
         return getSubjectGenerator().create(....)
             .iterator();
       }
     }.test();
   }

  
Returns java.lang.reflect.Method instances for the tests that assume multisets support duplicates so that the test of Multisets.forSet() can suppress them.
 
   @GwtIncompatible("reflection")
    return Arrays.asList(
        Helpers.getMethod(MultisetIteratorTester.class"testIteratorKnownOrder"),
        Helpers.getMethod(MultisetIteratorTester.class"testIteratorUnknownOrder"),
        Helpers.getMethod(MultisetIteratorTester.class"testRemovingIteratorKnownOrder"),
        Helpers.getMethod(MultisetIteratorTester.class"testRemovingIteratorUnknownOrder"));
  }
New to GrepCode? Check out our FAQ X