### Question:
MD5Filter implements ISOFilter, Configurable { protected byte[] getKey() { return key.getBytes(); } MD5Filter(); void setConfiguration(Configuration cfg); void setFields(int[] fields); int[] getFields(ISOMsg m); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt);  }### Answer:
@Test public void testGetKey() throws Throwable { MD5Filter mD5Filter = new MD5Filter(); mD5Filter.setConfiguration(new SimpleConfiguration()); byte[] result = mD5Filter.getKey(); assertEquals(0, result.length, "result.length"); }
@Test public void testGetKeyThrowsNullPointerException() throws Throwable { MD5Filter mD5Filter = new MD5Filter(); try { mD5Filter.getKey(); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"String.getBytes()\" because \"this.key\" is null", ex.getMessage(), "ex.getMessage()"); } } }