return suite;
}
static TestSuite filterBiMapSuite() {
TestSuite suite = new TestSuite("FilterBiMap");
suite.addTest(BiMapTestSuiteBuilder.using(new TestStringBiMapGenerator() {
@Override
protected BiMap<String, String> create(Entry<String, String>[] entries) {
BiMap<String, String> map = HashBiMap.create();
putEntries(map, entries);
map.putAll(ENTRIES_TO_FILTER);
return Maps.filterKeys(map, FILTER_KEYS);
}
})
.named("Maps.filterKeys[BiMap, Predicate]")
.withFeatures(
MapFeature.ALLOWS_NULL_KEYS,
MapFeature.ALLOWS_NULL_VALUES,
MapFeature.GENERAL_PURPOSE,
CollectionSize.ANY)
.createTestSuite());
suite.addTest(BiMapTestSuiteBuilder.using(new TestStringBiMapGenerator() {
@Override
protected BiMap<String, String> create(Entry<String, String>[] entries) {
BiMap<String, String> map = HashBiMap.create();
putEntries(map, entries);
map.putAll(ENTRIES_TO_FILTER);
return Maps.filterValues(map, FILTER_VALUES);
}
})
.named("Maps.filterValues[BiMap, Predicate]")
.withFeatures(
MapFeature.ALLOWS_NULL_KEYS,
MapFeature.ALLOWS_NULL_VALUES,
MapFeature.ALLOWS_ANY_NULL_QUERIES,
MapFeature.GENERAL_PURPOSE,
CollectionSize.ANY)
.createTestSuite());
suite.addTest(BiMapTestSuiteBuilder.using(new TestStringBiMapGenerator() {
@Override
protected BiMap<String, String> create(Entry<String, String>[] entries) {
BiMap<String, String> map = HashBiMap.create();
putEntries(map, entries);
map.putAll(ENTRIES_TO_FILTER);