### Question:
BSHLogListener implements org.jpos.util.LogListener, org.jpos.core.Configurable { protected void addScriptInfo(String filename, String code, long lastModified){ Objects.requireNonNull(filename, "The script file name cannot be null"); scripts.put(filename, new ScriptInfo(code, lastModified)); } BSHLogListener(); @Override void setConfiguration(org.jpos.core.Configuration cfg); @Override LogEvent log(LogEvent ev);  }### Answer:
@Test public void testAddScriptInfo() throws Throwable { BSHLogListener bSHLogListener = new BSHLogListener(); bSHLogListener.addScriptInfo("testBSHLogListenerFilename", "testBSHLogListenerCode", 100L); assertEquals(1, bSHLogListener.scripts.size(), "bSHLogListener.scripts.size()"); }
@Test public void testAddScriptInfoThrowsNullPointerException() throws Throwable { BSHLogListener bSHLogListener = new BSHLogListener(); try { bSHLogListener.addScriptInfo(null, "testBSHLogListenerCode", 100L); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertEquals("The script file name cannot be null", ex.getMessage()); assertEquals(0, bSHLogListener.scripts.size()); } }