UnionShape extends NamedMembersShape implements ToSmithyBuilder<UnionShape> { public static Builder builder() { return new Builder(); } private  UnionShape(Builder builder); static Builder builder(); @Override Builder toBuilder(); @Override R accept(ShapeVisitor<R> cases); @Override Optional<UnionShape> asUnionShape();  }
@Test public void returnsAppropriateType() { UnionShape shape = UnionShape.builder() .id("ns.foo#bar") .addMember(MemberShape.builder() .id("ns.foo#bar$baz") .target("ns.foo#bam") .build()) .build(); assertEquals(shape.getType(), ShapeType.UNION); }
@Test public void mustNotContainMembersInShapeId() { Assertions.assertThrows(SourceException.class, () -> { UnionShape.builder().id("ns.foo#bar$baz").build(); }); }