TinylogContextProvider implements ContextProvider { @Override public void remove(final String key) { Map<String, String> map = new HashMap<String, String>(data.get()); map.remove(key); data.set(map.isEmpty() ? Collections.<String, String>emptyMap() : Collections.unmodifiableMap(map)); } TinylogContextProvider(); @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 remove() { TinylogContextProvider provider = new TinylogContextProvider(); provider.put("a", 1); provider.put("b", 2); assertThat(provider.getMapping()).containsOnly(entry("a", "1"), entry("b", "2")); provider.remove("a"); assertThat(provider.getMapping()).containsOnly(entry("b", "2")); provider.remove("b"); assertThat(provider.getMapping()).isEmpty(); }