Class MultimapTestSuiteBuilder.KeysGenerator<K,V,M extends Multimap<K,V>>
java.lang.Object
com.google.common.collect.testing.google.MultimapTestSuiteBuilder.KeysGenerator<K,V,M>
- All Implemented Interfaces:
DerivedGenerator,TestMultisetGenerator<K>,TestCollectionGenerator<K>,TestContainerGenerator<Collection<K>,K>
static class MultimapTestSuiteBuilder.KeysGenerator<K,V,M extends Multimap<K,V>>
extends Object
implements TestMultisetGenerator<K>, DerivedGenerator
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKeysGenerator(OneSizeTestContainerGenerator<M, Map.Entry<K, V>> multimapGenerator) -
Method Summary
Modifier and TypeMethodDescriptionCreates a new container containing the given elements.K[]createArray(int length) Helper method to create an array of the appropriate type used by this generator.Returns the iteration ordering of elements, given the order in which they were added to the container.samples()Returns the sample elements that this generate populates its container with.
-
Field Details
-
multimapGenerator
-
-
Constructor Details
-
KeysGenerator
-
-
Method Details
-
getInnerGenerator
- Specified by:
getInnerGeneratorin interfaceDerivedGenerator
-
samples
Description copied from interface:TestContainerGeneratorReturns the sample elements that this generate populates its container with.- Specified by:
samplesin interfaceTestContainerGenerator<K,V>
-
create
Description copied from interface:TestContainerGeneratorCreates a new container containing the given elements. TODO: would be nice to figure out how to use E... or E[] as a parameter type, but this doesn't seem to work because Java creates an array of the erased type.- Specified by:
createin interfaceTestContainerGenerator<K,V> - Specified by:
createin interfaceTestMultisetGenerator<K>
-
sampleValuesIterator
-
createArray
Description copied from interface:TestContainerGeneratorHelper method to create an array of the appropriate type used by this generator. The returned array will contain only nulls.- Specified by:
createArrayin interfaceTestContainerGenerator<K,V>
-
order
Description copied from interface:TestContainerGeneratorReturns the iteration ordering of elements, given the order in which they were added to the container. This method may return the original list unchanged, the original list modified in place, or a different list.If the order is non-deterministic, as with
HashSet, this method can return its input unmodified. Provided that the test suite is built withoutCollectionFeature.KNOWN_ORDER, the tests will look only at the returned contents without regard for order.- Specified by:
orderin interfaceTestContainerGenerator<K,V>
-