Java 类com.google.common.collect.testing.google.SetMultimapTestSuiteBuilder 实例源码

项目:guava-libraries    文件:ConstrainedSetMultimapTest.java   
public static Test suite() {
  return SetMultimapTestSuiteBuilder.using(
      new TestStringSetMultimapGenerator() {

        @Override
        protected SetMultimap<String, String> create(Entry<String, String>[] entries) {
          SetMultimap<String, String> multimap = HashMultimap.create();
          for (Entry<String, String> entry : entries) {
            multimap.put(entry.getKey(), entry.getValue());
          }
          return MapConstraints.constrainedSetMultimap(multimap, Constraint.INSTANCE);
        }
      })
      .named("MapConstraints.constrainedSetMultimap")
      .withFeatures(
          MapFeature.ALLOWS_NULL_KEYS,
          MapFeature.ALLOWS_NULL_VALUES,
          MapFeature.ALLOWS_ANY_NULL_QUERIES,
          MapFeature.GENERAL_PURPOSE,
          CollectionSize.ANY,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.SUPPORTS_ITERATOR_REMOVE)
      .createTestSuite();
}