### Question:
StubBase implements SessionMessage { public Object sessionQuery( Object query ) throws Exception { if (_obj instanceof ObjSession) return ((ObjSession) _obj)._sessionQuery( query ); throw new UnsupportedOperationException( "unknown query "+query ); } StubBase( DeliveryService svc, T obj, Pool queued, Pool free ); @SuppressWarnings("unchecked") final boolean sessionMessage( Who sender, Message msg ); Object sessionQuery( Object query ); void sessionControl( Object control, Object value ); void sessionNotify( Object event ); static void sessionNotify( Object obj, Object event );  }### Answer:
@Test public void sessionQuery() throws Exception { Object QUERY = "foo"; Object RESULT = "bar"; assertNull( session.what ); assertNull( session.query ); session.query_result = RESULT; Object result = stub.sessionQuery( QUERY ); assertSame( What.SESSION_QUERY, session.what ); assertSame( QUERY, session.query ); assertSame( RESULT, result ); }