|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.collect.testing.google.UnmodifiableCollectionTests
@GwtCompatible public class UnmodifiableCollectionTests
A series of tests that support asserting that collections cannot be modified, either through direct or indirect means.
Constructor Summary | |
---|---|
UnmodifiableCollectionTests()
|
Method Summary | ||
---|---|---|
static
|
assertCollectionIsUnmodifiable(Collection<E> collection,
E sampleElement)
Verifies that a collection is immutable. |
|
static void |
assertIteratorIsUnmodifiable(Iterator<?> iterator)
Verifies that an Iterator is unmodifiable. |
|
static void |
assertIteratorsInOrder(Iterator<?> expectedIterator,
Iterator<?> actualIterator)
Asserts that two iterators contain elements in tandem. |
|
static void |
assertMapEntryIsUnmodifiable(Map.Entry<?,?> entry)
|
|
static
|
assertMultimapIsUnmodifiable(Multimap<K,V> multimap,
K sampleKey,
V sampleValue)
Verifies that a multimap is immutable. |
|
static
|
assertMultisetIsUnmodifiable(Multiset<E> multiset,
E sampleElement)
Verifies that a multiset is immutable. |
|
static
|
assertSetIsUnmodifiable(Set<E> set,
E sampleElement)
Verifies that a set is immutable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnmodifiableCollectionTests()
Method Detail |
---|
public static void assertMapEntryIsUnmodifiable(Map.Entry<?,?> entry)
public static void assertIteratorIsUnmodifiable(Iterator<?> iterator)
This test only works with iterators that iterate over a finite set.
public static void assertIteratorsInOrder(Iterator<?> expectedIterator, Iterator<?> actualIterator)
This test only works with iterators that iterate over a finite set.
public static <E> void assertCollectionIsUnmodifiable(Collection<E> collection, E sampleElement)
A collection is considered immutable if:
collection
- the presumed-immutable collectionsampleElement
- an element of the same type as that contained by
collection
. collection
may or may not have sampleElement
as a member.public static <E> void assertSetIsUnmodifiable(Set<E> set, E sampleElement)
A set is considered immutable if:
set
- the presumed-immutable setsampleElement
- an element of the same type as that contained by
set
. set
may or may not have sampleElement
as a
member.public static <E> void assertMultisetIsUnmodifiable(Multiset<E> multiset, E sampleElement)
A multiset is considered immutable if:
multiset
- the presumed-immutable multisetsampleElement
- an element of the same type as that contained by
multiset
. multiset
may or may not have sampleElement
as a member.public static <K,V> void assertMultimapIsUnmodifiable(Multimap<K,V> multimap, K sampleKey, V sampleValue)
A multimap is considered immutable if:
multimap
- the presumed-immutable multimapsampleKey
- a key of the same type as that contained by
multimap
. multimap
may or may not have sampleKey
as
a key.sampleValue
- a key of the same type as that contained by
multimap
. multimap
may or may not have sampleValue
as a key.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |