### Question:
SLF4JSegmentListener implements SegmentListener { @Override public void onSetEntity(Entity oldEntity, Entity newEntity) { if (newEntity == null) { MDC.remove(TRACE_ID_KEY); return; } Segment segment = newEntity instanceof Segment ? ((Segment) newEntity) : newEntity.getParentSegment(); if (segment != null && segment.getTraceId() != null && segment.isSampled() && newEntity.getId() != null) { String fullPrefix = StringValidator.isNullOrBlank(this.prefix) ? "" : this.prefix + ": "; MDC.put(TRACE_ID_KEY, fullPrefix + segment.getTraceId() + "@" + newEntity.getId()); } else { MDC.remove(TRACE_ID_KEY); } } SLF4JSegmentListener();  SLF4JSegmentListener(String prefix); String getPrefix(); void setPrefix(String prefix); @Override void onSetEntity(Entity oldEntity, Entity newEntity); @Override void onClearEntity(Entity entity);  }### Answer:
@Test public void testDefaultPrefix() { SLF4JSegmentListener listener = (SLF4JSegmentListener) AWSXRay.getGlobalRecorder().getSegmentListeners().get(0); Segment seg = new SegmentImpl(AWSXRay.getGlobalRecorder(), "test", traceID); listener.onSetEntity(null, seg); Assert.assertEquals(TRACE_ID_KEY + ": " + traceID.toString() + "@" + seg.getId(), MDC.get(TRACE_ID_KEY)); }