Class AbstractMapTester<K extends @Nullable java.lang.Object,​V extends @Nullable java.lang.Object>

    • Method Detail

      • getMap

        protected java.util.Map<K,​VgetMap()
      • actualContents

        protected java.util.Collection<java.util.Map.Entry<K,​V>> actualContents()
        Specified by:
        actualContents in class AbstractContainerTester<java.util.Map<K extends @Nullable java.lang.Object,​V extends @Nullable java.lang.Object>,​java.util.Map.Entry<K extends @Nullable java.lang.Object,​V extends @Nullable java.lang.Object>>
        Returns:
        the contents of the container under test, for use by expectContents(E...) and its friends.
      • resetMap

        protected void resetMap​(java.util.Map.Entry<K,​V>[] entries)
      • createArrayWithNullKey

        protected java.util.Map.Entry<K,​V>[] createArrayWithNullKey()
        Returns:
        an array of the proper size with null as the key of the middle element.
      • createArrayWithNullValue

        protected java.util.Map.Entry<K,​V>[] createArrayWithNullValue()
        Returns:
        an array of the proper size with null as the value of the middle element.
      • expectNullKeyMissingWhenNullKeysUnsupported

        protected void expectNullKeyMissingWhenNullKeysUnsupported​(java.lang.String message)
        Equivalent to expectMissingKeys (null) except that the call to contains(null) is permitted to throw a NullPointerException.
        Parameters:
        message - message to use upon assertion failure
      • expectNullValueMissingWhenNullValuesUnsupported

        protected void expectNullValueMissingWhenNullValuesUnsupported​(java.lang.String message)
        Equivalent to expectMissingValues (null) except that the call to contains(null) is permitted to throw a NullPointerException.
        Parameters:
        message - message to use upon assertion failure
      • getSampleEntries

        protected java.util.Collection<java.util.Map.Entry<K,​V>> getSampleEntries​(int howMany)
      • getSampleEntries

        protected java.util.Collection<java.util.Map.Entry<K,​V>> getSampleEntries()
      • expectMissing

        protected void expectMissing​(java.util.Map.Entry<K,​V>... entries)
        Overrides:
        expectMissing in class AbstractContainerTester<java.util.Map<K extends @Nullable java.lang.Object,​V extends @Nullable java.lang.Object>,​java.util.Map.Entry<K extends @Nullable java.lang.Object,​V extends @Nullable java.lang.Object>>
      • entry

        protected java.util.Map.Entry<K,​Ventry​(K key,
                                                       V value)
      • expectContents

        protected void expectContents​(java.util.Collection<java.util.Map.Entry<K,​V>> expected)
        Description copied from class: AbstractContainerTester
        Asserts that the collection under test contains exactly the given elements, respecting cardinality but not order. Subclasses may override this method to provide stronger assertions, e.g., to check ordering in lists, but realize that unless a test extends AbstractListTester, a call to expectContents() invokes this version.
        Overrides:
        expectContents in class AbstractContainerTester<java.util.Map<K extends @Nullable java.lang.Object,​V extends @Nullable java.lang.Object>,​java.util.Map.Entry<K extends @Nullable java.lang.Object,​V extends @Nullable java.lang.Object>>
        Parameters:
        expected - expected value of AbstractContainerTester.container
      • expectReplacement

        protected final void expectReplacement​(java.util.Map.Entry<K,​V> newEntry)
      • get

        protected V get​(K key)
        Wrapper for Map.get(Object) that forces the caller to pass in a key of the same type as the map. Besides being slightly shorter than code that uses getMap(), it also ensures that callers don't pass an Map.Entry by mistake.
      • k0

        protected final K k0()
      • v0

        protected final V v0()
      • k1

        protected final K k1()
      • v1

        protected final V v1()
      • k2

        protected final K k2()
      • v2

        protected final V v2()
      • k3

        protected final K k3()
      • v3

        protected final V v3()
      • k4

        protected final K k4()
      • v4

        protected final V v4()