MultisetBeanPropertyTest.java 文件源码

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

项目:FreeBuilder 作者:
@Test
public void testImmutableSetProperty() {
  behaviorTester
      .with(new Processor(features))
      .with(new SourceBuilder()
          .addLine("package com.example;")
          .addLine("@%s", FreeBuilder.class)
          .addLine("public abstract class DataType {")
          .addLine("  public abstract %s<%s> getItems();", ImmutableMultiset.class, String.class)
          .addLine("")
          .addLine("  public static class Builder extends DataType_Builder {}")
          .addLine("  public static Builder builder() {")
          .addLine("    return new Builder();")
          .addLine("  }")
          .addLine("}")
          .build())
      .with(new TestBuilder()
          .addLine("com.example.DataType value = new com.example.DataType.Builder()")
          .addLine("    .addItems(\"one\")")
          .addLine("    .addItems(\"two\")")
          .addLine("    .build();")
          .addLine("assertThat(value.getItems()).iteratesAs(\"one\", \"two\");")
          .build())
      .runTest();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号