code: private static JsonObjectBuilder addAnnotations( JsonObjectBuilder builder, IAnnotated annotated)
      {
      JsonObjectBuilder annotations = Json.createObjectBuilder();
      toStream( annotated.getAnnotations()).forEach( name -> annotations.add( name, annotated.getAnnotation( name)));
      JsonObject json = annotations.build();
  
      if( !json.isEmpty())
        {
        builder.add( HAS_KEY, json);
        }
  
      return builder;
      }
docs: Add any annotatations from the given Annotated object to the given JsonObjectBuilder.