### Question:
PropagatorStack implements Propagator { public PropagatorStack pushPropagator(Propagator propagator) { if (propagator == null) { throw new IllegalArgumentException("propagator cannot be null"); } propagators.add(propagator); return this; } PropagatorStack(Format format); Format format(); PropagatorStack pushPropagator(Propagator propagator); SpanContext extract(C carrier); void inject(SpanContext context, C carrier);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testPushPropagator_Null() { PropagatorStack propagatorStack = new PropagatorStack(Builtin.HTTP_HEADERS); propagatorStack.pushPropagator(null); }
@Test public void testPushPropagator() { Propagator b3Propagator = new B3Propagator(); PropagatorStack propagatorStack = new PropagatorStack(Builtin.HTTP_HEADERS); assertEquals(propagatorStack.pushPropagator(Propagator.HTTP_HEADERS), propagatorStack); assertEquals(propagatorStack.pushPropagator(b3Propagator), propagatorStack); assertEquals(propagatorStack.propagators.size(), 2); assertEquals(propagatorStack.propagators.get(0), Propagator.HTTP_HEADERS); assertEquals(propagatorStack.propagators.get(1), b3Propagator); }