@Test
public void omitsDefaultsFromSerializedNode() {

    TraitFactory provider = TraitFactory.createServiceFactory();
    ObjectNode node = Node.objectNode()
            .withMember("origin", Node.from("*"))
            .withMember("maxAge", Node.from(600))
            .withMember("additionalAllowedHeaders", Node.fromStrings())
            .withMember("additionalExposedHeaders", Node.fromStrings());
    Optional<Trait> trait = provider.createTrait(ShapeId.from("smithy.api#cors"), ShapeId.from("ns.qux#foo"), node);
    assertTrue(trait.isPresent());
    assertThat(trait.get(), instanceOf(CorsTrait.class));
    ObjectNode serialized = ((CorsTrait) trait.get()).createNode().expectObjectNode();
    assertFalse(serialized.getMember("origin").isPresent());
    assertFalse(serialized.getMember("maxAge").isPresent());
    assertFalse(serialized.getMember("additionalAllowedHeaders").isPresent());
    assertFalse(serialized.getMember("additionalExposedHeaders").isPresent());
}