### Question:
BSHFilter implements RawIncomingFilter, Configurable { public ISOMsg filter (ISOChannel channel, ISOMsg m, LogEvent evt) throws VetoException { return filter (channel, m, null, null, evt); } BSHFilter(); void setConfiguration(Configuration cfg); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt); ISOMsg filter(ISOChannel channel, ISOMsg m, byte[] header, byte[] image, LogEvent evt);  }### Answer:
@Test public void testFilter() throws Throwable { Configuration cfg = new SimpleConfiguration(); BSHFilter bSHFilter = new BSHFilter(); bSHFilter.setConfiguration(cfg); ISOMsg result = bSHFilter.filter(new PADChannel(), null, new LogEvent("testBSHFilterTag", "testString")); assertNull(result, "result"); assertSame(cfg, bSHFilter.cfg, "bSHFilter.cfg"); }
@Test public void testFilterThrowsNullPointerException() throws Throwable { BSHFilter bSHFilter = new BSHFilter(); LogEvent evt = new LogEvent(); try { bSHFilter.filter(new CSChannel("testBSHFilterHost", 100, new PostPackager()), new ISOMsg("testBSHFilterMti"), evt); 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.getAll(String)\" because \"this.cfg\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(bSHFilter.cfg, "bSHFilter.cfg"); } }