### Question:
DtmRequestInterceptor implements RequestInterceptor { @Override public void apply(RequestTemplate template) { DTMContext dtmContext = DTMContext.getDTMContext(); long gid = dtmContext.getGlobalTxId(); if (gid != -1) { DtmContextDTO dtmContextDTO = DtmContextDTO.fromDtmContext(dtmContext); template.header(DtmConstants.DTM_CONTEXT, Json.encode(dtmContextDTO)); } }  @Override void apply(RequestTemplate template);  }### Answer:
@Test public void apply() { DtmRequestInterceptor dtmRequestInterceptor = new DtmRequestInterceptor(); RequestTemplate template = new RequestTemplate(); DTMContext dtmContext = DTMContext.getDTMContext(); dtmContext.setGlobalTxId(100); dtmRequestInterceptor.apply(template); assertNotNull(template.header(DtmConstants.DTM_CONTEXT)); }