private int expectedResults() throws Exception {
   Object o = (new InitialContext()).lookup("MyMessageChecker");
   MessageCheckerHome home =
       (MessageCheckerHome) PortableRemoteObject.narrow(o, MessageCheckerHome.class);
   MessageChecker checker = home.create();
   return checker.expectedResults();
 }
 private void notifyAndWait() throws Exception {
   Object o = (new InitialContext()).lookup("MyMessageChecker");
   MessageCheckerHome home =
       (MessageCheckerHome) PortableRemoteObject.narrow(o, MessageCheckerHome.class);
   MessageChecker checker = home.create();
   checker.notifyAndWait();
 }
 private boolean checkResults(int num) throws Exception {
   Object o = (new InitialContext()).lookup("MyMessageChecker");
   MessageCheckerHome home =
       (MessageCheckerHome) PortableRemoteObject.narrow(o, MessageCheckerHome.class);
   MessageChecker checker = home.create();
   int result = checker.getMessageCount();
   return result == num;
 }