SpanReportListenerHolder { public static List<SpanReportListener> getSpanReportListenersHolder() { return spanReportListenersHolder; }  static List<SpanReportListener> getSpanReportListenersHolder(); static void addSpanReportListeners(List<SpanReportListener> spanReportListenersHolder); static void addSpanReportListener(SpanReportListener spanReportListener); static void clear();  }
@Test public void testGetSpanReportListenersHolder() throws Exception { SpanReportListener listener1 = new SpanReportListener() { @Override public void onSpanReport(SofaTracerSpan sofaTracerSpan) { } }; SpanReportListener listener2 = new SpanReportListener() { @Override public void onSpanReport(SofaTracerSpan sofaTracerSpan) { } }; SpanReportListenerHolder.addSpanReportListener(listener1); SpanReportListenerHolder.addSpanReportListener(listener2); assertEquals(2, SpanReportListenerHolder.getSpanReportListenersHolder().size()); SpanReportListenerHolder.clear(); assertEquals(0, SpanReportListenerHolder.getSpanReportListenersHolder().size()); List<SpanReportListener> listenerList = new ArrayList<SpanReportListener>(); listenerList.add(listener1); listenerList.add(listener2); SpanReportListenerHolder.addSpanReportListeners(listenerList); assertEquals(2, SpanReportListenerHolder.getSpanReportListenersHolder().size()); }