ListMultimapMutateMethodTest.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:FreeBuilder 作者:
@Test
public void mutateAndAddAtIndexViaAsMapKeepsSubstitute() {
  behaviorTester
      .with(new Processor(features))
      .with(INTERNED_PROPERTY)
      .with(testBuilder()
          .addLine("String s = new String(\"foobar\");")
          .addLine("String i = s.intern();")
          .addLine("assertThat(s).isNotSameAs(i);")
          .addLine("DataType value = new DataType.Builder()")
          .addLine("    .putAllItems(\"one\", ImmutableList.of(\"A\", \"B\", \"C\"))")
          .addLine("    .mutateItems(items -> %s.asMap(items).get(\"one\").add(2, s))",
              Multimaps.class)
          .addLine("    .build();")
          .addLine("assertThat(value.getItems().get(\"one\").get(2)).isSameAs(i);")
          .build())
      .runTest();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号