@Test
public void removesTraitsFromProtocolDefinitionWhenReferenceRemoved() {

    Model model = Model.assembler()
            .addImport(getClass().getResource("remove-shapes.json"))
            .assemble()
            .unwrap();
    ShapeId removedId = ShapeId.from("ns.foo#baz");
    Shape removedShape = model.expectShape(removedId);
    ModelTransformer transformer = ModelTransformer.create();
    Model result = transformer.removeShapes(model, Collections.singletonList(removedShape));
    ShapeId subjectId = ShapeId.from("ns.foo#protocol");
    Shape subject = result.expectShape(subjectId);
    ProtocolDefinitionTrait trait = subject.getTrait(ProtocolDefinitionTrait.class).get();
    assertFalse(trait.getTraits().contains(removedId));
}