### Question:
SpanAdapter { static Span.Event toProtoSpanEvent(Event event) { final Span.Event.Builder builder = Span.Event.newBuilder(); builder.setName(event.getName()); builder.setTimeUnixNano(event.getEpochNanos()); event .getAttributes() .forEach( new AttributeConsumer() { @Override public <T> void consume(AttributeKey<T> key, T value) { builder.addAttributes(CommonAdapter.toProtoAttribute(key, value)); } }); builder.setDroppedAttributesCount( event.getTotalAttributeCount() - event.getAttributes().size()); return builder.build(); } private  SpanAdapter();   }### Answer:
@Test void toProtoSpanEvent_WithoutAttributes() { assertThat( SpanAdapter.toProtoSpanEvent( Event.create(12345, "test_without_attributes", Attributes.empty()))) .isEqualTo( Span.Event.newBuilder() .setTimeUnixNano(12345) .setName("test_without_attributes") .build()); }
@Test void toProtoSpanEvent_WithAttributes() { assertThat( SpanAdapter.toProtoSpanEvent( Event.create( 12345, "test_with_attributes", Attributes.of(stringKey("key_string"), "string"), 5))) .isEqualTo( Span.Event.newBuilder() .setTimeUnixNano(12345) .setName("test_with_attributes") .addAttributes( KeyValue.newBuilder() .setKey("key_string") .setValue(AnyValue.newBuilder().setStringValue("string").build()) .build()) .setDroppedAttributesCount(4) .build()); }