### Question:
PlainMailboxManager implements MailboxManager { public boolean sessionMessage( Who sender, Message msg ) throws Exception { Long msgid = msg.getInReplyTo(); if (msgid != null) { Mailbox mb = getMailbox( msgid ); if (mb != null) { try { return mb.message( sender, msg ); } catch ( InterruptedException e ) { } } return false; } return session.sessionMessage( sender, msg ); } PlainMailboxManager( TransportMessage transport, String uri,
		Resources resources );  PlainMailboxManager( TransportMessage transport, URL uri,
		Resources resources ); TransportMessage getTransport(); @Override String toString(); boolean sessionMessage( Who sender, Message msg ); void transportMessage( Who recipient, Message msg ); Mailbox transportCall( Who recipient, Message msg ); void register( Mailbox mb ); void unregister( Mailbox mb ); Mailbox getMailbox( Long msgid ); void redeliver( Who sender, Message msg ); int size(); Object sessionQuery( Object query ); void sessionControl( Object control, Object value ); void sessionNotify( Object event ); Object transportQuery( Object query ); void transportControl( Object control, Object value ); void transportNotify( Object event ); SessionMessage getSession(); void setSession( SessionMessage session );  }### Answer:
@Test public void sessionMessage1() throws Exception { assertNull( session.what ); assertNull( session.sender ); assertNull( session.msg ); Message msg = constructAddMessage(); session.msg_handled = true; boolean msg_handled = mmgr.sessionMessage( who, msg ); assertTrue( msg_handled ); assertSame( What.SESSION_MESSAGE, session.what ); assertSame( who, session.sender ); assertSame( msg, session.msg ); }
@Test public void sessionMessage2() throws Exception { assertNull( session.what ); assertNull( session.sender ); assertNull( session.msg ); Message msg = constructAddMessage(); session.msg_handled = false; boolean msg_handled = mmgr.sessionMessage( who, msg ); assertFalse( msg_handled ); assertSame( What.SESSION_MESSAGE, session.what ); assertSame( who, session.sender ); assertSame( msg, session.msg ); }
@Test public void sessionMessage3() throws Exception { assertNull( session.what ); assertNull( session.sender ); assertNull( session.msg ); Message msg = constructAddResultMessage(); msg.setInReplyTo( 1L ); session.msg_handled = true; boolean msg_handled = mmgr.sessionMessage( who, msg ); assertFalse( msg_handled ); assertNull( session.what ); assertNull( session.sender ); assertNull( session.msg ); }
@Test public void sessionMessage4() throws Exception { assertNull( session.what ); assertNull( session.sender ); assertNull( session.msg ); Message msg = constructAddResultMessage(); msg.setInReplyTo( 1L ); session.msg_handled = false; boolean msg_handled = mmgr.sessionMessage( who, msg ); assertFalse( msg_handled ); assertNull( session.what ); assertNull( session.sender ); assertNull( session.msg ); }