JBossContextProvider implements ContextProvider { @Override public Map<String, String> getMapping() { Map<String, Object> objectMap = MDC.getMap(); if (objectMap.isEmpty()) { return Collections.emptyMap(); } else { Map<String, String> stringMap = new HashMap<String, String>(objectMap.size()); for (Entry<String, Object> entry : objectMap.entrySet()) { stringMap.put(entry.getKey(), String.valueOf(entry.getValue())); } return stringMap; } } JBossContextProvider(); @Override Map<String, String> getMapping(); @Override String get(final String key); @Override void put(final String key, final Object value); @Override void remove(final String key); @Override void clear();  }
@Test public void emptyMapping() { Map<String, String> mapping = new JBossContextProvider().getMapping(); assertThat(mapping).isEmpty(); }