### Question:
DelayFilter implements ISOFilter, Configurable { public void setConfiguration (Configuration cfg) { delay = cfg.getInt ("delay"); } DelayFilter();  DelayFilter(int delay); void setConfiguration(Configuration cfg); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt);  }### Answer:
@Test public void testSetConfiguration() throws Throwable { DelayFilter delayFilter = new DelayFilter(100); delayFilter.setConfiguration(new SimpleConfiguration()); assertEquals(0, delayFilter.delay, "delayFilter.delay"); }
@Test public void testSetConfigurationThrowsNullPointerException() throws Throwable { DelayFilter delayFilter = new DelayFilter(100); Configuration cfg = new SubConfiguration(); try { delayFilter.setConfiguration(cfg); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.core.Configuration.getInt(String)\" because \"this.cfg\" is null", ex.getMessage(), "ex.getMessage()"); } assertEquals(100, delayFilter.delay, "delayFilter.delay"); } }