@Test
public void unionShape() {

    Shape variant1Shape = StringShape.builder().id("ns.foo#V1String").build();
    Shape variant2Shape = StringShape.builder().id("ns.foo#V2String").build();
    UnionShape union = UnionShape.builder()
            .id("ns.foo#name")
            .addMember(MemberShape.builder()
                    .id("ns.foo#name$tag1")
                    .target(variant1Shape.getId())
                    .build())
            .addMember(MemberShape.builder()
                    .id("ns.foo#name$tag2")
                    .target(variant2Shape.getId())
                    .build())
            .build();
    MemberShape v1Target = union.getMember("tag1").get();
    MemberShape v2Target = union.getMember("tag2").get();
    Model model = Model.builder()
            .addShape(union)
            .addShape(variant1Shape)
            .addShape(variant2Shape)
            .addShape(v1Target)
            .addShape(v2Target)
            .build();
    NeighborVisitor neighborVisitor = new NeighborVisitor(model);
    List<Relationship> relationships = union.accept(neighborVisitor);
    assertThat(relationships, containsInAnyOrder(
            Relationship.create(union, RelationshipType.UNION_MEMBER, v1Target),
            Relationship.create(union, RelationshipType.UNION_MEMBER, v2Target)));
}