@Override
  public String convert(ILoggingEvent event) {
    Map<String, String> mdcPropertyMap = event.getMDCPropertyMap();

    if (mdcPropertyMap == null) {
      return defaultValue;
    }

    if (key == null) {
      return outputMDCForAllKeys(mdcPropertyMap);
    } else {

      String value = mdcPropertyMap.get(key);
      if (value != null) {
        return value;
      } else {
        return defaultValue;
      }
    }
  }
@Test
  public void testConvertWithMultipleEntries() {
    MDC.put("testKey", "testValue");
    MDC.put("testKey2", "testValue2");
    ILoggingEvent le = createLoggingEvent();
    String result = converter.convert(le);
    boolean isConform = result.matches("testKey2?=testValue2?, testKey2?=testValue2?");
    assertTrue(result + " is not conform", isConform);
  }