DefaultMdcEntry implements MdcEntry { @Override public String getKey() { return key; } private  DefaultMdcEntry(final String key, @Nullable final String value); static DefaultMdcEntry of(final CharSequence key, @Nullable final CharSequence value); @Override String getKey(); @Nullable @Override String getValueOrNull(); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void getKey() { final String key = "foo"; final DefaultMdcEntry underTest = DefaultMdcEntry.of(key, "bar"); assertThat(underTest.getKey()).isEqualTo(key); }