### Question:
QMUX extends QBeanSupport implements SpaceListener, MUX, QMUXMBean, Loggeable, MetricsProvider { protected void processUnhandled (ISOMsg m) { ISOSource source = m.getSource(); source = source != null ? source : this; Iterator iter = listeners.iterator(); if (iter.hasNext()) synchronized (this) { rxForwarded++; } while (iter.hasNext()) if (((ISORequestListener)iter.next()).process (source, m)) return; if (unhandled != null) { synchronized (this) { rxUnhandled++; } sp.out (unhandled, m, 120000); } } QMUX(); void initService(); void startService(); void stopService(); void destroyService(); static MUX getMUX(String name); ISOMsg request(ISOMsg m, long timeout); void request(ISOMsg m, long timeout, ISOResponseListener rl, Object handBack); @Override void notify(Object k, Object value); String getKey(ISOMsg m); @Override Metrics getMetrics(); synchronized void setInQueue(String in); String getInQueue(); synchronized void setOutQueue(String out); String getOutQueue(); Space getSpace(); synchronized void setUnhandledQueue(String unhandled); String getUnhandledQueue(); @SuppressWarnings("unused") String[] getReadyIndicatorNames(); void addISORequestListener(ISORequestListener l); boolean removeISORequestListener(ISORequestListener l); synchronized void resetCounters(); String getCountersAsString(); int getTXCounter(); int getRXCounter(); @Override int getTXExpired(); @Override int getTXPending(); @Override int getRXExpired(); @Override int getRXPending(); @Override int getRXUnhandled(); @Override int getRXForwarded(); long getLastTxnTimestampInMillis(); long getIdleTimeInMillis(); void send(ISOMsg m); boolean isConnected(); void dump(PrintStream p, String indent);  }### Answer:
@Test public void testProcessUnhandled() throws Throwable { ISOMsg m = new ISOMsg("testQMUXMti"); m.setSource(new PADChannel(new EuroSubFieldPackager())); QMUX qMUX = new QMUX(); qMUX.processUnhandled(m); assertEquals(0, qMUX.listeners.size(), "qMUX.listeners.size()"); }
@Test public void testProcessUnhandled1() throws Throwable { QMUX qMUX = new QMUX(); ISOMsg m = new ISOMsg("testQMUXMti"); qMUX.processUnhandled(m); assertNull(qMUX.sp, "qMUX.sp"); assertEquals(0, qMUX.listeners.size(), "qMUX.listeners.size()"); assertEquals(0, m.getDirection(), "m.getDirection()"); }
@Test public void testProcessUnhandledThrowsNullPointerException() throws Throwable { QMUX qMUX = new QMUX(); try { qMUX.processUnhandled(null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.iso.ISOMsg.getSource()\" because \"m\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(qMUX.sp, "qMUX.sp"); assertEquals(0, qMUX.listeners.size(), "qMUX.listeners.size()"); } }