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

ConstrainedSetMultimapTest.java 文件源码 项目:guava-libraries 阅读 22 收藏 0 点赞 0 评论 0
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();
}


问题


面经


文章

微信
公众号

扫码关注公众号