### Question:
RecordEventsReadableSpan implements ReadWriteSpan { @Override public void addEvent(String name) { if (name == null) { return; } addTimedEvent(Event.create(clock.now(), name, Attributes.empty(), 0)); } private  RecordEventsReadableSpan(
      SpanContext context,
      String name,
      InstrumentationLibraryInfo instrumentationLibraryInfo,
      Kind kind,
      String parentSpanId,
      boolean hasRemoteParent,
      TraceConfig traceConfig,
      SpanProcessor spanProcessor,
      Clock clock,
      Resource resource,
      @Nullable AttributesMap attributes,
      List<SpanData.Link> links,
      int totalRecordedLinks,
      long startEpochNanos); @Override SpanData toSpanData(); @Override boolean hasEnded(); @Override SpanContext getSpanContext(); @Override String getName(); @Override InstrumentationLibraryInfo getInstrumentationLibraryInfo(); @Override long getLatencyNanos(); @Override void setAttribute(String key, String value); @Override void setAttribute(String key, long value); @Override void setAttribute(String key, double value); @Override void setAttribute(String key, boolean value); @Override void setAttribute(AttributeKey<T> key, T value); @Override void addEvent(String name); @Override void addEvent(String name, long timestamp); @Override void addEvent(String name, Attributes attributes); @Override void addEvent(String name, Attributes attributes, long timestamp); @Override void setStatus(StatusCanonicalCode canonicalCode); @Override void setStatus(StatusCanonicalCode canonicalCode, @Nullable String description); @Override void recordException(Throwable exception); @Override void recordException(Throwable exception, Attributes additionalAttributes); @Override void updateName(String name); @Override void end(); @Override void end(EndSpanOptions endOptions); @Override SpanContext getContext(); @Override boolean isRecording(); @Override String toString();  }### Answer:
@Test void addEvent() { RecordEventsReadableSpan span = createTestRootSpan(); try { span.addEvent("event1"); span.addEvent("event2", Attributes.of(stringKey("e1key"), "e1Value")); } finally { span.end(); } List<Event> events = span.toSpanData().getEvents(); assertThat(events.size()).isEqualTo(2); }