log.error("--  SetStateEvent, cnt=" + cnt);
System.err.println("--  SetStateEvent, cnt=" + cnt);
   public void testBasicStateSync() throws Exception {      Channel channel = new JChannel(CHANNEL_PROPS);      channel.setOpt(Channel.LOCAL, Boolean.FALSE);      channel.connect(GROUP_NAME);      Thread.sleep(1000);      boolean join = false;      join = channel.getState(null, 100000l);      assertTrue(join);      Object tmp;      int cnt = -1;      while (true) {         try {            tmp = channel.receive(0);            if (tmp instanceof ExitEvent) {               break;            }            if (tmp instanceof SetStateEvent) {               cnt = ((Integer) Util.objectFromByteBuffer(((SetStateEvent) tmp).getArg())).intValue();               log.error("--  SetStateEvent, cnt=" + cnt);               continue;            }            if ( tmp instanceof Message ) {               if (cnt != -1) {                  int msg = ((Integer) ((Message) tmp).getObject()).intValue();                  assertEquals(cnt, msg - 1);                  break;  // done               }            }         } catch (ChannelNotConnectedException not) {            break;         } catch (ChannelClosedException closed) {            break;         } catch (Exception e) {            log.error(e);            continue;         }      }      channel.close();   }