### Question:
FlexBubbleContainer extends FlexMessageContainer { public static Builder newBuilder() { return new Builder(); } private  FlexBubbleContainer(); private  FlexBubbleContainer(Builder builder); static Builder newBuilder(); @NonNull @Override JSONObject toJsonObject();  }### Answer:
@Test public void body_with_only_texts() throws JSONException { givenFlexBubbleContainer(FlexBubbleContainer.newBuilder().setBody(FlexBoxComponent.newBuilder( FlexMessageComponent.Layout.HORIZONTAL, Arrays.asList(textComponent, textComponent) ).build())); messageShouldBe("{" + " \"type\": \"bubble\"," + " \"body\": {" + " \"type\": \"box\"," + " \"layout\": \"horizontal\"," + " \"contents\": [" + " {" + " \"type\": \"text\"," + " \"text\": \"Hello !\"" + " }," + " {" + " \"type\": \"text\"," + " \"text\": \"Hello !\"" + " }" + " ]" + " }" + "}"); }
@Test public void hero_with_image() throws JSONException { givenFlexBubbleContainer(FlexBubbleContainer.newBuilder().setHero(imageComponent)); messageShouldBe("{" + " \"type\": \"bubble\"," + " \"hero\": {" + " \"type\": \"image\"," + " \"url\": \"https: " }" + "}"); }
@Test public void all_fields() throws JSONException { FlexBoxComponent boxComponent = FlexBoxComponent.newBuilder( FlexMessageComponent.Layout.HORIZONTAL, Arrays.asList(new FlexMessageComponent[]{textComponent, imageComponent}) ).build(); givenFlexBubbleContainer( FlexBubbleContainer.newBuilder() .setStyles(new FlexBubbleContainer.Style()) .setDirection(FlexBubbleContainer.Direction.LEFT_TO_RIGHT) .setHeader(boxComponent) .setBody(boxComponent) .setHero(imageComponent) .setFooter(boxComponent) ); messageShouldBe("{" + " \"type\": \"bubble\"," + " \"direction\": \"ltr\"," + " \"header\": {" + " \"type\": \"box\"," + " \"layout\": \"horizontal\"," + " \"contents\": [" + " {" + " \"type\": \"text\"," + " \"text\": \"Hello !\"" + " }," + " {" + " \"type\": \"image\"," + " \"url\": \"https: " }" + " ]" + " }," + " \"hero\": {" + " \"type\": \"image\"," + " \"url\": \"https: " }," + " \"body\": {" + " \"type\": \"box\"," + " \"layout\": \"horizontal\"," + " \"contents\": [" + " {" + " \"type\": \"text\"," + " \"text\": \"Hello !\"" + " }," + " {" + " \"type\": \"image\"," + " \"url\": \"https: " }" + " ]" + " }," + " \"footer\": {" + " \"type\": \"box\"," + " \"layout\": \"horizontal\"," + " \"contents\": [" + " {" + " \"type\": \"text\"," + " \"text\": \"Hello !\"" + " }," + " {" + " \"type\": \"image\"," + " \"url\": \"https: " }" + " ]" + " }," + " \"styles\": {}" + "}"); }