AnnotationTrait implements Trait { @Override public final Node toNode() { return node; } AnnotationTrait(ShapeId id, ObjectNode node); @Override final ShapeId toShapeId(); @Override final Node toNode(); @Override final SourceLocation getSourceLocation(); @Override int hashCode(); @Override boolean equals(Object other);  }
@Test public void annotationTraitsAreNotLossy() { ObjectNode objectNode = new ObjectNode( MapUtils.of(Node.from("hi"), Node.from("bye")), SourceLocation.NONE); SensitiveTrait trait = new SensitiveTrait.Provider().createTrait(ShapeId.from("foo#bar"), objectNode); assertThat(trait.toNode(), equalTo(objectNode)); }