@Test
public void removesTraitsWithComposedPredicate() {

    ShapeId aId = ShapeId.from("ns.foo#A");
    StringShape a = StringShape.builder()
            .id(aId)
            .addTrait(new SensitiveTrait())
            .addTrait(new DocumentationTrait("docs", SourceLocation.NONE))
            .addTrait(DeprecatedTrait.builder().build())
            .build();
    Model model = Model.builder().addShape(a).build();
    ModelTransformer transformer = ModelTransformer.create();
    Model result = transformer.filterTraits(
            model, (shape, trait) -> !trait.toShapeId().equals(ShapeId.from("smithy.api#sensitive"))
                                     && !trait.toShapeId().equals(ShapeId.from("smithy.api#documentation")));
    assertThat(result.shapes().count(), Matchers.is(1L));
    assertThat(result.getShape(aId).get().getTrait(SensitiveTrait.class), Matchers.is(Optional.empty()));
    assertThat(result.getShape(aId).get().getTrait(DocumentationTrait.class), Matchers.is(Optional.empty()));
    assertThat(result.getShape(aId).get().getTrait(DeprecatedTrait.class), Matchers.not(Optional.empty()));
}