### Question:
MdcLoggingContextService implements LoggingContextService { @Override public void storeRequestInformation(RequestInfo requestInfo) { if (requestInfo == null) { return; } MDC.put(INTERNAL_REQUEST_ID_KEY, requestInfo.getInternalRequestId()); MDC.put(X_REQUEST_ID_KEY, requestInfo.getXRequestId()); MDC.put(INSTANCE_ID_KEY, requestInfo.getInstanceId()); }  @Override void storeConsentStatus(@NotNull ConsentStatus consentStatus); @Override String getConsentStatus(); @Override void storeTransactionStatus(@NotNull TransactionStatus transactionStatus); @Override String getTransactionStatus(); @Override void storeScaStatus(@NotNull ScaStatus scaStatus); @Override void storeTransactionAndScaStatus(@NotNull TransactionStatus transactionStatus, @Nullable ScaStatus scaStatus); @Override String getScaStatus(); @Override void storeRequestInformation(RequestInfo requestInfo); @Override RequestInfo getRequestInformation(); @Override void clearContext();  }### Answer:
@Test void storeRequestInformation_shouldPutRequestIdsIntoMdc() { mdcLoggingContextService.storeRequestInformation(new RequestInfo(INTERNAL_REQUEST_ID, X_REQUEST_ID, INSTANCE_ID)); assertEquals(INTERNAL_REQUEST_ID, MDC.get(INTERNAL_REQUEST_ID_KEY)); assertEquals(X_REQUEST_ID, MDC.get(X_REQUEST_ID_KEY)); assertEquals(INSTANCE_ID, MDC.get(INSTANCE_ID_KEY)); }
@Test void storeRequestInformation_nullValues_shouldOverwriteMdcValues() { MDC.put(INTERNAL_REQUEST_ID_KEY, INTERNAL_REQUEST_ID); MDC.put(X_REQUEST_ID_KEY, X_REQUEST_ID); MDC.put(INSTANCE_ID_KEY, INSTANCE_ID); mdcLoggingContextService.storeRequestInformation(new RequestInfo(null, null, null)); assertNull(MDC.get(INTERNAL_REQUEST_ID_KEY)); assertNull(MDC.get(X_REQUEST_ID_KEY)); assertNull(MDC.get(INSTANCE_ID_KEY)); }
@Test void storeRequestInformation_null_shouldPreserveMdcValues() { MDC.put(INTERNAL_REQUEST_ID_KEY, INTERNAL_REQUEST_ID); MDC.put(X_REQUEST_ID_KEY, X_REQUEST_ID); MDC.put(INSTANCE_ID_KEY, INSTANCE_ID); mdcLoggingContextService.storeRequestInformation(null); assertEquals(INTERNAL_REQUEST_ID, MDC.get(INTERNAL_REQUEST_ID_KEY)); assertEquals(X_REQUEST_ID, MDC.get(X_REQUEST_ID_KEY)); assertEquals(INSTANCE_ID, MDC.get(INSTANCE_ID_KEY)); }