MDC { @SuppressWarnings({ "rawtypes", "unchecked" }) public static Hashtable getContext() { return new Hashtable(ThreadContext.getMapping()); } private  MDC(); @SuppressWarnings({ "rawtypes", "unchecked" }) static Hashtable getContext(); static Object get(final String key); static void put(final String key, final Object value); static void remove(final String key); static void clear();  }
@SuppressWarnings("unchecked") @Test public void getContext() { when(provider.getMapping()).thenReturn(doubletonMap("e", "2.71", "pi", "3.14")); assertThat(MDC.getContext()).contains(entry("e", "2.71"), entry("pi", "3.14")); }