public void testServerRetransmissionHiding() throws Exception {
  String oldRetransValue=System.getProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
  System.setProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS,"2");
  stunStack.addRequestListener(serverAddress,requestCollector);
  stunStack.sendRequest(bindingRequest,serverAddress,clientAddress,responseCollector);
  Thread.sleep(1000);
  Vector<StunMessageEvent> reqs=requestCollector.getRequestsForTransaction(bindingRequest.getTransactionID());
  assertTrue("Retransmissions of a binding request were propagated " + "to the server",reqs.size() <= 1);
  if (oldRetransValue != null)   System.getProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS,oldRetransValue);
 else   System.clearProperty(StackProperties.MAX_CTRAN_RETRANSMISSIONS);
}

public void testServerRetransmissionHiding ( ) throws Exception { String oldRetransValue = System . getProperty ( StackProperties . MAX_CTRAN_RETRANSMISSIONS ) ; System . setProperty ( StackProperties . MAX_CTRAN_RETRANSMISSIONS , "2" ) ; stunStack . addRequestListener ( serverAddress , requestCollector ) ; stunStack . sendRequest ( bindingRequest , serverAddress , clientAddress , responseCollector ) ; Thread . sleep ( 1000 ) ; Vector < StunMessageEvent > reqs = requestCollector . getRequestsForTransaction ( bindingRequest . getTransactionID ( ) ) ; assertTrue ( "Retransmissions of a binding request were propagated " + "to the server" , reqs . size ( ) <= 1 ) ; if ( oldRetransValue != null ) System . getProperty ( StackProperties . MAX_CTRAN_RETRANSMISSIONS , oldRetransValue ) ; else System . clearProperty ( StackProperties . MAX_CTRAN_RETRANSMISSIONS ) ; }
make sure that retransmissions are not seen by the server user and that it only gets a single request .
